Venezuelan intelligence agents have released opposition leader and congress chief Juan Guaido after briefly detaining him on the way to a political rally, a congressional official has said.

A video posted on social media appears to show the moment Guaido was pulled from a car on a highway by the Bolivarian National Intelligence Service (Sebin) on Sunday as he was travelling out of the capital, Caracas.

While it was not possible to identify the individual in the video, his wife and opposition legislators said that he had been detained.

He was released about an hour later, they added.

Urgente.....vean como fue el secuestro de @GuaiF Narcodictadura asesina pic.twitter.com/pUO53nVrH4 — Antonio Ledezma (@alcaldeledezma) 13 January 2019

At a rally shortly afterwards, Guaido told opposition supporters "the game has changed", the Reuters news agency reported.

"Here we are! We are not afraid!," Guaido said.

Information Minister Jorge Rodriguez told state television the detention was an "irregular procedure" by rogue agents who wanted to help the opposition create a "media show," adding that the agents would face disciplinary action, Reuters reported.

The Lima Group - made up of a bloc of countries from the Americas including Brazil, Canada and Mexico - issued a statement condemning the "arbitrary detention".

Calls for Maduro's removal

The leader of Venezuela's National Assembly, Guaido said at an anti-government rally in Caracas on Friday that he was willing to assume the Latin American country's presidency after the opposition declared President Nicolas Maduro's second term to be illegitimate.

The assembly was rendered powerless by Venezuela's Supreme Court after Maduro's ruling Socialist Party lost control of it in 2016.

"I assume the duty imposed by the Constitution and Article 333, which obliges all Venezuelans, vested with authority or not, to fight for the restitution of constitutional order," the assembly quoted Guaido as saying in a series of posts on Twitter.

Guaido, a legislator from the hardline Popular Will opposition party, added that he would only take office with the support of the armed forces.

Maduro was quick to dismiss the National Assembly as a "show of little boys" following Guaido's comments, telling reporters that while the "crazy and immature minds at the head of the opposition" were holding their demonstration, he was working.

Venezuela's prison minister, meanwhile, said was ready to jail Guaido.

"I've already prepared your cell and your uniform, I hope you name your cabinet quickly so I know who is going down with you," she said in a Tweet on Friday.

Controversy over second term

Maduro was sworn in to a second term on Thursday, defying critics in the United States and Latin America who have labelled the 56-year-old an illegitimate "usurper".

The political heir to late leftist President Hugo Chavez, Maduro has presided over an economic collapse in oil-rich Venezuela which has seen soaring hyperinflation and widespread shortages of food and medicine.

Initially elected in 2013, he was restored to office during an election last May that was widely condemned by the international community.

The ballot was called for by the majority pro-Maduro Constituent Assembly and boycotted by the opposition, many of whose best-known leaders were under house arrest or barred from running.

Turnout for the single-round vote was about 46 percent, according to Venezuela's National Electoral Council (CNE).

Nearly 72 percent of voters now want Maduro to resign, according to a recent survey by the country's most reliable pollster, Datanalisis.