Bishkek, Kyrgyzstan (CNN) -- Ousted Kyrgyz President Kurmanbek Bakiev left the country and resigned Thursday after negotiations among the government, the president, and international states and agencies.
The Kazakh Foreign Ministry said a plane carrying Bakiev had landed in Taraz, a town in bordering Kazakhstan. An official in the interim Kyrgyz government, Edil Basilyev, a senior adviser to interim government chairwoman Roza Otunbayeva, said Bakiev had resigned.
Kanat Saudabayev, Kazakhstan's secretary of state and foreign minister, said in a statement an agreement was reached with the interim government of Kyrgyzstan and Bakiev for the president's departure.
Bakiev had said he was willing to resign if he and his relatives were allowed safe passage out of the country.
That came as a result of efforts by Kazakh President Nursultan Nazarbayev, U.S. President Barack Obama and Russian President Dmitry Medvedev and a number of agencies, including the Organization for Security and Co-operation in Europe, the United Nations and the European Union.
"Mr. Bakiev has already left Kyrgyzstan," said Saudabayev, who is now serving as the OSCE chairperson-in-office. The OSCE is a regional security organization consisting of 56 states from Europe, Central Asia and North America.
"This development is an important step towards the stabilization of the situation, a return to a framework providing for the rule of law, and the prevention of a civil war in Kyrgyzstan," Saudabayev said.
Saudabayev urged "all political forces" in the central Asian nation "to ensure stability, public order and the rule of law, and to address the most pressing social and economic problems as soon as possible."
Demonstrations and violence wracked the former Soviet state last week, resulting in the deaths of more than 80 people in civil unrest.
Kyrgyzstan is very important to both Russia and the United States. Russian is the second language in Kyrgyzstan and Russia has a military base there. The United States also has a military base there that is a key supply link for U.S. and NATO forces in the Afghan war.
Protests that began last Tuesday in the northern city of Talas led to governmental upheaval. They were sparked by increases in electricity and fuel rates, which had gone up at the first of the year as Bakiev's government sold public utilities to companies controlled by his friends.
Demonstrations spread to the capital of Bishkek a day later after the government arrested opposition leaders in Talas, protests that resulted in violence and prompted the president's flight from the capital to southern Kyrgyzstan.
Protesters took over the main government offices in the capital, including the presidential palace, and ushered in the formation of an interim government led by political opposition leaders.
The office of the prosecutor general has brought a number of criminal charges against relatives and associates of Bakiev. On Thursday, the interim government said the country's former defense minister, Bakit Kaliyev, has been arrested. Bakiev himself has been accused of stealing the country's money when he fled the capital.
Earlier Thursday, Bakiev escaped unhurt when his supporters clashed with opponents and his bodyguards shot into the air to disperse the crowd. As Bakiev's motorcade drove away, some in the crowd threw stones at it, state media said.
Russian media corrected earlier witness reports that said Bakiev had been shot at during a rally in the southern city of Osh.
Rather, said the independent Interfax News Agency, Bakiev had arrived to speak to about 500 people in the city's main square. But supporters of the interim government -- which took power after Bakiev was deposed last week -- prevented him from taking the stage.
Several hundred policemen in the square did not intervene during the skirmishes, said the RIA-Novosti news agency.
It was the second day of competing pro- and anti-Bakiev rallies in the south.
CNN's Ben Wedeman contributed to this report.