Two of Venezuela's leading opposition figures, who were detained a day after a controversial constitutional vote, have been sent to jail on the orders of the country's top court.

The Supreme Tribunal on Tuesday revoked house arrest measures granted to Leopoldo Lopez and Antonio Ledezma and put them back in jail because the opposition leaders were planning to flee.

Lopez, 46, and Ledezma, 62, both former mayors in the capital Caracas, were seized from their homes overnight on Tuesday, according to their relatives and supporters.

The opposition, which boycotted the constituent assembly election held on Sunday, says President Nicolas Maduro wants to consolidate power through the new super-legislative body tasked to reform the country's constitution.

The Venezuelan president hailed the election victory, that according to the electoral body saw the participation of more than eight million people - 41 percent of the nearly 20 million registered voters. The opposition disputes the voting figures.

The United States has called for the "immediate release" of the two leaders. The administration of President Donald Trump slapped sanctions after the election, which it dubbed a "sham" and "step towards dictatorship". Regional governments in Argentina, Colombia and Peru have also refused to recognise the vote.

READ MORE: Venezuela's crisis explained from the beginning

A defiant Maduro said the US move smacked of "imperialism" and added that he would proceed with the plans to rewrite the Constitution, which was last amended by his predecessor, Hugo Chavez in 1999.

The opposition has been staging street protests for the past four months demanding Maduro's resignation for presiding over the worst economic crisis in decades.

"Maduro's dictatorship is on the attack," said opposition legislator Yajaira Forero.

Juan Carlos Gutierrez, the attorney of Lopez, said the government's decision to return him to prison was "completely arbitrary" and there was no arrest warrant. Lopez had obeyed the conditions imposed on his house arrest, Gutierrez said.

According to him, Lopez and Ledezma were both in Ramo Verde prison, a decrepit penitentiary next to a slum in Los Teques, about an hour's drive from Caracas.

UN rights chief concerned

UN Secretary-General Antonio Guterres has called for urgent political negotiations between the Venezuelan government and the opposition, adding that "the only way forward is a political solution".

"The Secretary-General urges all Venezuelans, particularly those representing the powers of the State, to make all possible efforts to lower tensions, prevent further violence and loss of life, as well as find avenues for political dialogue," Stephane Dujarric, the UN spokesman, said in a statement.

Earlier, Zeid Raad Al Hussein, the UN High Commissioner for Human Rights, said that he was "deeply concerned" at the arrest of the opposition figures.

"I urge the government to immediately release all those being held for exercising their rights to freedom of peaceful assembly, association and expression," he said.

Lopez had been sent home from Ramo Verde, a military prison, on July 8 after serving three years of a 13-year sentence for inciting violence at opposition rallies. Many human rights groups considered him a political prisoner.

Ledezma had been under house arrest since 2015 on charges of plotting a coup.

His allies posted on social media a video of a man who appeared to be Ledezma dressed in his pyjamas being dragged out of his building by what appeared to be state security as a woman screams for help for neighbours.

"They're taking Ledezma!" she cries. "It's a dictatorship!"

A similar video was posted on Twitter by the wife of Lopez, Lilian Tintori.

"They've just taken Leopoldo from the house," she wrote on Twitter.

Constituent Assembly

Both leaders recently posted videos online denouncing President Maduro's decision to hold the July 30 vote for a constitutional assembly.

Maduro called the constitutional assembly in May after a month of protests against his government, which has overseen Venezuela's descent into a crisis that has seen an acute shortage of food and medicines.

The new assembly will begin to govern within a week, said Maduro, who has been very critical of the opposition tactics and has vowed to send activists involved in protests to prison.

Among other measures, he said he would use the assembly's powers to bar opposition candidates from running in gubernatorial elections due in December unless they sit with his party to negotiate an end to hostilities that have generated four months of protests. At least 120 have been killed and nearly 2,000 wounded in the protests.

The petroleum-rich nation was plunged into an economic crisis after global oil prices drastically fell nearly three years ago. The opposition has accused Maduro of corruption and economic mismanagement for Venezuela's woes.