Venezuela's former presidential opposition candidate Edmundo Gonzalez has left for Spain in the wake of the country's contested election.
Venezuelan and Spanish officials confirmed his departure on Saturday night after a day of rising diplomatic tensions.
Mr Gonzalez, 75, who ran against President Nicolas Maduro in July, left after "voluntarily seeking refuge in the Spanish embassy in Caracas several days ago," Venezuelan Vice-President Delcy Rodriguez posted on Instagram.
Caracas said it had agreed to his safe passage.
"Edmundo Gonzalez has taken off from Caracas heading to Spain on a Spanish Air Force plane," Spain's Foreign Minister Jose Manuel Albares posted on X, saying Madrid was responding to a request for political asylum from Mr Gonzalez.
He said Spain would "obviously" grant it, after insisting the nation was "committed to the political rights" of all Venezuelans".
Speaking at a socialist party meeting on Saturday, Spain's Prime Minister Pedro Sanchez described Mr Gonzalez as "a hero who Spain will not abandon".
Mr Gonzalez's exit from Venezuela is the latest political development since the country's election on July 28.
Democracies around the world have criticised the Venezuelan government's handling of the vote, which election officials and its top court say was won by Mr Maduro.
Venezuela's opposition say the election resulted in a resounding victory for Mr Gonzalez, and published vote tallies online that they say show he won.
This week, prosecutors issued an arrest warrant for Mr Gonzalez in connection to the online publication of the tallies, accusing him of usurping functions, falsifying public documents and conspiracy, among other charges.
Earlier on Saturday, Venezuela's government revoked Brazil's authorisation to represent Argentine interests in the country, including administering the embassy where six opposition figures are sheltering.
Venezuela broke relations with Argentina after the presidential election.
Brazil, like Colombia and Mexico, has asked the Venezuelan government to publish the full results of the vote.
The government has not done so and the country's electoral authority said Mr Maduro won re-election for a third term.
In a statement, Venezuela said the decision, effective immediately, was due to proof that the embassy was being used to plan assassination attempts against Mr Maduro and Mr Rodriguez.
Brazil said it had received the communication that its authorisation had been revoked "with surprise."
Argentina said it rejected the "unilateral" decision.
Both countries urged Mr Maduro to respect the Vienna Convention on Diplomatic Relations.
"Any attempt to invade or kidnap asylum seekers who remain in our official residence will be harshly condemned by the international community," Argentina said in a statement.
"Actions like these reinforce the conviction that in Maduro's Venezuela, fundamental human rights are not respected."
A Brazilian diplomatic source said on Saturday afternoon that Venezuela had assured Brazil it would not invade the embassy.
In its statement, Brazil insisted it would remain in custody and defence of Argentine interests until Argentina indicated another state acceptable to Venezuela to do so.
"The Brazilian government highlights in this context, under the terms of the Vienna Conventions, the inviolability of the facilities of the Argentine diplomatic mission," it said, adding that it housed six Venezuelan asylum seekers, assets and archives.
In March, six people sought asylum in the Argentine embassy in Caracas after a prosecutor ordered their arrest on charges including conspiracy.
Opposition leader Maria Corina Machado has denied the allegations against her collaborators.
On Friday night, some opposition members in the Argentine residence reported on their X accounts that the building was under surveillance and had no electricity.
They posted videos showing men dressed in black and patrols from the government intelligence agency, SEBIN.
Argentina's Foreign Ministry asked the International Criminal Court on Friday to issue an arrest warrant against Mr Maduro and other senior government officials for events that occurred after the elections.
Reuters