An Italian court has ordered the ex-president of Spain's Catalonia region to be freed following his arrest in Sardinia, his lawyer said.
Carles Puigdemont is free to leave the island but must return for a hearing in October.
He was arrested on a Spanish arrest warrant on Thursday.
Mr Puigdemont fled Catalonia after leading a breakaway independence vote in the region in 2017. He later became a member of the European Parliament.
Italian police were waiting for the former Catalan president at Alghero airport in Sardinia on Thursday and he was taken to a nearby prison.
He travelled to the Italian island on Thursday for a Catalan folklore festival, his lawyer said, and was held overnight in Sassari prison, a short distance from the airport.
Spain accuses him of sedition but his lawyers say the European arrest warrant is no longer valid. Prime Minister Pedro Sánchez said "it's clear that Carles Puigdemont must be brought to justice and stand trial".
Hundreds of protesters rallied outside the Italian consulate in Barcelona, the capital of Catalonia, on Friday morning demanding his release.
Pardon for Catalan colleagues
The 2017 breakaway referendum prompted Spain's deepest political crisis for decades, with the Catalan regional parliament declaring independence, and Madrid then imposing direct rule over the region.
After Mr Puigdemont and two ministerial colleagues fled, Spain jailed nine other Catalan leaders for sedition for their role in the breakaway vote. They were pardoned by Spanish Prime Minister Pedro Sánchez in June.
The former Catalan president now lives in Belgium and his lawyers have successfully fought off a Spanish extradition bid in the past.
CRISIS IN CATALONIA: A brief guide to Spain's regional crisis
When he became an MEP in 2019, the Catalan ex-leader initially had immunity from prosecution but the Parliament voted to strip him of that last March. He appealed against the decision but in an initial ruling at the end of July the EU's general court said there was no immediate risk of arrest.
There are at least two questions facing the Italian judiciary: the validity of the Spanish extradition request, and the powers of Italian judges when the case is yet to receive a ruling by the EU's general court.
Spanish authorities say the European arrest warrant was "never deactivated". And Mr Puigdemont's lawyers say that no court within the EU can execute a European arrest warrant until a final ruling has been made.
Headache for Spain
This arrest is awkward for Spain's leftist coalition government.
Although the administration of Socialist Pedro Sánchez insisted that the Italian authorities' actions should be respected and that "nobody can avoid justice", this comes at a sensitive time.
Earlier this month, Mr Sánchez resumed negotiations with the pro-independence Catalan government aimed at finding a solution to the longstanding territorial crisis.
Although both sides in the talks are still extremely far apart, the Spanish government hopes that the process will eventually lead to a lasting solution in the north-eastern region. The government has already pardoned nine jailed independence leaders.
Mr Puigdemont embodies a relatively uncompromising strain of Catalan separatism, and his detention fuels claims by pro-independence Catalans that their leaders, and ideology, are being persecuted. It all inhibits the Spanish leader's attempts to calm tensions surrounding the Catalan issue.
Prime Minister Sánchez said although Mr Puigdemont had fled while Spain was under another government, the current left-wing administration respected and stuck to judicial decisions.
Catalonia's new president Pere Aragones - also a separatist - condemned the "persecution" of Mr Puigdemont.
Catalonia is one of Spain's richest regions and already has a high degree of autonomy. But many Catalans feel they pay more to Madrid than they get back, and there are historical grievances too, in particular Catalonia's treatment under the dictatorship of General Franco.