Venezuela opposition leader Juan Guaido declared himself the country's interim president on Wednesday before thousands of demonstrators cheering in support.

"I swear to formally assume the powers of the presidency of Venezuela," the 35-year-old politician said as he raised his right hand.

The move comes as tens of thousands marched around Venezuela demanding that Nicolas Maduro step down from power. Pro-government counterrallies are also being held.

In a seemingly coordinated action, the US led a chorus of Western hemisphere nations, including Canada, Brazil, Argentina and Colombia, that immediately backed the bold challenge, with President Donald Trump calling on Maduro to resign and promising to use the "full weight" of the US economic and diplomatic power to push for the restoration of Venezuela's democracy.

In response, Maduro, who was sworn in for a controversial second term earlier this month, announced he was severing diplomatic with the United States, the biggest importer of the OPEC nation's oil, and accused the opposition of attempting a coup.

"Before the people and nations of the world, and as constitutional president .... I've decided to break diplomatic and political relations with the imperialist US government," Maduro thundered while holding up a decree banning the diplomats before a crowd of red-shirted supporters gathered at the presidential palace.

"Don't trust the gringos," he said. "They don't have friends or loyalties. They only have interests, guts and the ambition to take Venezuela's oil, gas and gold."

Regional powers throw support behind Guaido

Maduro's rebuke came after Trump said: "people of Venezuela have courageously spoken out against Maduro and his regime and demanded freedom and the rule of law".

Canada, Brazil, Colombia, Guatemala, Chile, Peru and Argentina, among others, and the leader of the Organization of American States (OAS) followed the US in recognising Guaido as the acting president.

But Mexico's Foreign Ministry spokesperson said that the country did not intend to change its policy towards Venezuela "for the time being".

And both Bolivia and Cuba issued statements reaffirming their support for Maduro.

Maduro maintains that his presidency is legitimate and accuses the United States and other countries of waging an "economic war" to remove him from power.

He gave US diplomats 72 hours to leave the country, saying he was breaking off ties with the US.

Not to be undone, Guaido issued his own statement, urging foreign embassies to disavow Maduro's orders and keep their diplomats in the country.

Military backs Maduro

Amid the showdown, all eyes were on the military, the traditional arbiter of political disputes in Venezuela - and to whom Guaido has been targeting his message.

Maduro, who lacks the military pedigree of his mentor and predecessor, the late Hugo Chavez, has sought to shore up support from the armed forces by doling out key posts to top generals, including heading the PDVSA oil monopoly that is the source of virtually all of Venezuela's export earnings.

On Wednesday, Defense Minister Vladimir Padrino said on Twitter that the country's armed forces disavow any president who was self-proclaimed or imposed by "dark forces".

The challenge to Maduro's rule came after large crowds gathered in Caracas waving flags and chanting "Get out Maduro!" in what was the largest demonstration since a wave of unrest that left more than 120 dead in 2017.

Pro-government demonstrators dressed in red in support of Maduro were also marching in the capital, at times crossing paths with opposition protesters and shouting "sell-outs" and "traitors".

While the protests were mostly peaceful there were no signs that security forces heeded Guaido's call to join the anti-Maduro movement and go light on demonstrators.

Hours after most demonstrators went home violence broke out in Altamira, an upscale zone of Caracas and an opposition stronghold when National Guardsmen descended on hundreds of youths, some of them with their faces covered, lingering around a popular plaza. Popping tear gas canisters sent hundreds running and hordes of protesters riding two and three on motorcycles fleeing in panic.

Blocks away, a small group knocked a pair of guardsman riding tandem off their motorcycle, pelting them with coconuts as they sped down a wide avenue. Some in the group struck the two guardsmen with their hands while others ran off with their gear and set their motorcycle on fire.

Rallies the night before left four people reported dead, an echo of tumultuous riots two years ago.

Thirty-five-year-old Guaido was a virtually unknown politician at the start of the year, but has since reignited the hopes of Venezuela's often beleaguered opposition by taking a rebellious track amid a crushing economic crisis that has forced millions to flee or go hungry.

With additional reporting from Alicia Hernandez in Caracas and Elizabeth Melimopoulos in Doha.