Madrid on Sunday said it would grant political asylum to Venezuelan opposition leader Edmundo Gonzalez Urrutia, who was heading into exile in Spain after a month in hiding in the crisis-hit South American country.
Gonzalez Urrutia -- who disputed President Nicolas Maduro's July 28 re-election -- left Venezuela after ignoring three successive summons to appear before prosecutors, arguing that attending the hearing could have cost him his freedom.
Madrid's Foreign Minister Jose Manuel Albares said that Gonzalez Urrutia had requested political asylum in the European country, and that Spain would "obviously" grant it to him.
He earlier confirmed on X that the opposition leader had departed on a Spanish military aeroplane, adding that Spain was "committed to the political rights" of all Venezuelans.
Caracas said it had agreed to his safe passage.
Venezuela has been in political crisis since July when authorities declared Maduro the victor of the election.
The opposition cried foul, claiming it had evidence Gonzalez Urrutia had won by a comfortable margin.
Numerous nations, including the United States, European Union and several Latin American countries, have refused to recognise Maduro as the winner without Caracas releasing detailed voting data.
After the election, Venezuelan prosecutors issued an arrest warrant for Gonzalez Urrutia over his insistence that he was the rightful winner of the election.
Venezuela's vice president Delcy Rodriguez said on social media that Caracas had agreed to the safe passage of Gonzalez Urrutia, who had taken "refuge voluntarily at the Spanish embassy in Caracas a few days ago".
Speaking at a socialist party meeting on Saturday, Prime Minister Pedro Sanchez described Gonzalez Urrutia as "a hero who Spain will not abandon".
Attorney General Tarek William Saab said he would make an "important announcement", which the public prosecutor's office said would take place at 11:00 am (1500 GMT) on Sunday.
Lawyer Joel Garcia, who has defended opposition figures in Venezuela, said that if Gonzalez Urrutia was charged with everything the government has accused him of, he could face a jail sentence of 30 years.
Authorities said Maduro had won re-election to a third, six-year term with 52 percent of the vote.
The opposition published its own voting records, which it says showed Gonzalez Urrutia winning 67 percent of the vote.
Venezuela's electoral authority has said it cannot provide a full breakdown of the election results, blaming a cyber attack on its systems.
Observers have said there is no evidence of any such hacking.
Post-election violence in Venezuela has claimed 27 lives and left 192 people injured, while the government says it has arrested some 2,400 people.
Prior to the election, Gonzalez Urrutia was a little-known retired diplomat.
He became the last-minute presidential candidate after main opposition figure Maria Corina Machado was banned from running by state institutions seen as loyal to Maduro.
After Venezuela's last election, in 2018, Maduro was proclaimed winner amid widespread accusations of fraud.
He has led the oil-rich but cash-poor country since 2013.
His tenure -- which has suffered from domestic economic mismanagement as well as international sanctions -- has seen GDP drop 80 percent and more than seven million of the country's 30 million citizens emigrate.