President Kurmanbek Bakiyev was ousted in a bloody uprising this month
Deposed Kyrgyzstan President Kurmanbek Bakiyev has left the country and flown to neighbouring Kazakhstan.
His departure comes in the wake of a 7 April uprising that killed scores of people and forced him to flee the Kyrgyz capital of Bishkek.
He had been trying to muster support in his home region of Jalalabad in the south of the country.
Kyrgyzstan's interim government said Mr Bakiyev had signed a letter of resignation.
The Organization for Security and Co-operation in Europe (OSCE) said Mr Bakiyev's departure had been agreed with the US, Russia and the EU.
The Russian Interfax news agency said Mr Bakiyev may fly on to Turkey or Latvia, but this could not be confirmed.
AT THE SCENE
Rayhan Demytrie, BBC News, Jalalabad
I was outside Mr Bakiyev's home waiting to hear from him when we heard a plane taking off.
Jalalabad is a small town and there is only one flight a week from the airport.
We approached Mr Bakiyev's aides and they confirmed that the president had left the country.
Earlier he told supporters who turned up at his home that Kazakh President Nursultan Nazarbayev had invited him to come to the country for talks.
Kazakhstan holds the presidency for the Organization for Security and Co-operation in Europe this year and it wants to play a role in restoring order in Kyrgyzstan.
Mr Bakiyev's presence in the country was increasing the political deadlock.
In other developments on Thursday, Kyrgyzstan's former defence minister, a key ally of Mr Bakiyev, was arrested, according to Kyrgyz media.
Azattyk radio said Baktybek Kalyev was detained in southern Kyrgyzstan.
"He is accused of giving an illegal order to fire on unarmed citizens, leading to the deaths of dozens of citizens," it said, without naming its sources.
Gunfire had been heard earlier as Mr Bakiyev spoke in the southern city of Osh; an opposition rally was going on nearby.
Mr Bakiyev was quickly bundled into his car and driven back to Jalalabad where a plane was seen taking off from the nearby airport.
The plane later landed in the southern Kazakh city of Taraz, a Kazakh foreign ministry spokesman said.
Kazakhstan currently holds the presidency of the OSCE.
In a statement it said Mr Bakiyev's departure had been the result of joint efforts between Kazakh President Nursultan Nazarbayev, US President Barack Obama and Russia's President Dmitriy Medvedev.
It said the EU, the UN and OSCE had also been involved in "active mediation".
Shots are fired at the rally where deposed President Kurmanbek Bakiyev was speaking
Kyrgyzstan's opposition interim government which took over had been unable to reach any agreement with the ousted president.
Roza Otunbayeva, leader of the interim administration, had said Mr Bakiyev should stand trial over the recent unrest.
Mr Bakiyev had said he was ready to relinquish power if his safety could be guaranteed.
The BBC's Rayhan Demytrie, in Jalalabad, says Mr Bakiyev's presence in Kyrgyzstan had only been pushing the deadlock deeper.
The big question now is whether or not he will be able to come back, our correspondent adds.