(Adds Venezuela recalling envoy to Canada for talks)
CARACAS, Oct 17 (Reuters) - President Nicolas Maduro defended Venezuela's "secure" election system on Tuesday as opponents struggled to present a united front over allegations of fraud in a nationwide vote surprisingly won by the ruling socialists.
Despite widespread anger over economic hardship, the Socialist Party confounded opinion polls to take 17 of 23 governorships in Sunday's election.
Stunned by the defeat that undermines their aim to win the presidency in 2018, the opposition Democratic Unity coalition refused to acknowledge the results and called the election rigged, as did the United States.
Though the coalition has complained of an unfair playing field - from abuse of state resources to last-minute moving of vote centers away from opposition strongholds - it has not given detailed evidence of ballot-tampering.
Some opposition figures have acknowledged abstention by their supporters - disillusioned by the failure of street protests to dislodge Maduro earlier this year - was a big factor.
Two losing opposition candidates, Henri Falcon in Lara state and Alejandro Feo La Cruz in Carabobo, have conceded defeat, breaking with the official coalition position.
Both criticized "irregularities" in the vote but also lamented many demoralized opposition supporters stayed at home.
"We need courage to recognize truth in adversity," said Falcon.
The strongest criticism of Sunday's vote came from Washington, which slammed Maduro's "dictatorship." Several European nations also expressed concern, while 12 countries in the Americas from the so-called Lima Group condemned "obstacles, intimidation, manipulation and irregularities".
Washington is considering further sanctions on Venezuela, after various measures against top officials and the economy earlier this year, while the European Union is mulling the same.
Government leaders have smarted at fraud accusations.
"Venezuela's election system is the most secure and audited in the world," Maduro said on Tuesday. "President Donald Trump, I am not a dictator; I am a humble worker ... I have a moustache and look like Stalin, but I'm not him."
The Venezuelan leader invited EU foreign policy chief Federica Mogherini to visit or receive him in Brussels to "open their eyes," and told "stupid" Canada to stop meddling.
Foreign Minister Jorge Arreaza later said on Twitter that Maduro had recalled Venezuela's ambassador to Canada for talks.
'WE WILL NOT KNEEL'
Heaping further humiliation on Venezuela's opposition, the governors were due to be sworn in on Tuesday by a new legislative superbody elected controversially in July.
The opposition boycotted that vote and has refused to recognize the entirely pro-government Constituent Assembly, which supersedes all institutions including the opposition-controlled congress.
The opposition's five governors-elect planned to boycott the swearing-in ceremony, defying Maduro's threat to bar them from office for failing to accept the assembly as a higher authority.
"We will not kneel to anyone," said Juan Pablo Guanipa, who won the oil-rich western Zulia state.
Despite food shortages, runaway inflation and a tanking currency, Venezuela's government retains significant bastions of support, especially in poorer, rural parts of the country.
In his news conference, Maduro said the socialists also won Bolivar state, which would take its total to 18 governorships versus five for the opposition.
The government won a total of 54 percent of the votes overall, he added. The election board has not confirmed the Bolivar result or the overall vote figures.
With the opposition coalition's dozens of parties arguing over whether there was fraud, what went wrong, and where to go next, it will need to regroup and map strategy quickly heading into the 2018 presidential campaign.
Its very future may even be in doubt, since many young activists who took to the streets for four straight months of protests and pitched battles with security forces earlier this year feel betrayed by their leaders.
The unrest killed at least 125 people.
Maduro has long accused opposition leaders of being behind violence, and on Tuesday called the new opposition governor of Zulia state a "fascist" while accusing his counterpart in Tachira of links to Colombian "paramilitaries."
The election aftermath appears to have sunk a government-opposition mediation effort that began last month in the Dominican Republic. Even though Maduro wants to resuscitate the talks, the opposition coalition has ruled that out.
"We are the majority, the dictatorship is more-and-more illegitimate, popular and global condemnation grows daily against this regime," it said in a communique late on Monday. (Additional reporting by Diego Ore and Deisy Buitrago in Caracas, Tibisay Romero in Valencia and Helen Murphy in Bogota; Editing by Tom Brown)