Kurmanbek Bakiyev signed it on Thursday in the presence of the parliamentary speaker, officials and journalists.

The document was submitted to parliament after a week of protests and tensions during which it was feared that the former Soviet republic would descend into chaos less than two years after an uprising drove its longtime leader Askar Akayev from power.

Parliament approved the constitution on Wednesday in two quick votes just before midnight. Sixty-five lawmakers approved it in the final ballot, far more than the required two-thirds of the 75-seat parliament.

The constitution, worked out in talks between backers and opponents of Bakiyev, grants parliament more power.

Calm restored

Roza Otunbayeva, a former acting foreign minister and member of the opposition movement For Reforms, told demonstrators in the capital's parliament square after the constitution was signed:"This is our victory, this is a step toward peace. We can avoid civil war, civil confrontation."

Demonstrators waved flags and held sparklers in the air, while fireworks burst in the night sky over the capital city, Bishek.

Bakiyev came to power after opposition protests in March 2005, but his rule has been marred by high-profile killings, a weak economy, battles for control of lucrative businesses, and mounting anger over his reluctance to relinquish presidential authority.

The constitution

Adakhan Madumarov, the Kyrgyz secretary of state, said that the new constitution calls for a new 90-member parliament and for the majority party to name the prime minister, satisfying a key opposition demand.

However, according to a Kyrgyz lawmaker, the constitution also allows for the president to select a party that could choose the prime minister should the majority needed not be acheived.

In a concession to the president, Omurbek Tekebayev, leader of the opposition, said that the opposition agreed that Bakiyev and the current parliament will remain in place until their terms run out in July 2010.

The national security agency will now report to the cabinet, rather than to the president, Madumarov said.

Regional judges are to be appointed by a committee, yet to be formed, but is subject to presidential approval.

Underlying Kyrgyzstan's political struggles are clan rivalries and a deep north-south divide. Bakiyev is from the south.