The head of Venezuela's opposition-controlled parliament was briefly detained days after saying he was ready to assume the country's presidency.
Juan Guaidó was on his way to a rally when intelligence agents intercepted his car in a road north of the capital, Caracas, opposition members said.
The agents have been sacked over the "irregular" operation, Information Minister Jorge Rodríguez said.
President Nicolás Maduro was sworn in for a second six-year term on Thursday.
The opposition calls him illegitimate and Guaidó said on Friday he was ready to assume the Venezuelan presidency on an interim basis.
His wife, Fabiana Rosales, and daughter were travelling with him to a political rally in the northern state of Vargas.
Rosales announced her husband's detention on Twitter and video was posted on social media not long afterwards apparently showing the moment it happened.
He was released about an hour later.
Rodríguez said the agents had acted unilaterally as part of a "media show" and that they would go through disciplinary procedures.
The exact circumstances surrounding Sunday's events are still unclear, BBC South America correspondent Katy Watson reports.
But the arrest seems to be designed to send a message to those who oppose Maduro, our correspondent adds.
Two journalists who were covering the case - Beatriz Adrián, from Colombia's Caracol television, and Osmary Hernández, who works for CNN's Spanish news channel - were also briefly detained.
What's happening in Venezuela?
Earlier this month, Guaidó became the speaker of the National Assembly, which has been stripped of its powers since Maduro's ruling Socialist Party lost control of it in 2016.
Maduro dismissed his comments as a "show". His re-election in May last year was marred by an opposition boycott and allegations of vote-rigging.
Since taking office Maduro has been condemned at home and abroad for alleged human rights abuses and for his handling of the economy, which is in a state of near-collapse.
Venezuela is one of the world's largest oil producers but its overreliance on the product, which accounts for about 95% of its export earnings, left the country vulnerable when prices dropped in 2014.
As a result, the cost of imported goods like food and medicine has risen, and currency inflation has skyrocketed.
The government is also increasingly struggling to get credit after it defaulted on some of its government bonds. In response, the government has printed more money, devaluing the currency further.
Maduro was first elected in 2013, succeeding Hugo Chávez who died of cancer after governing for 14 years.