MOSCOW — Four days after vanishing during a wave of attacks on government buildings by opposition protesters, the president of Kyrgyzstan declared a state of emergency in the capital of his Central Asian country on Friday, ordering the military into the city to halt unrest, confining residents to their homes and banning public gatherings.
The beleaguered president, Sooronbai Jeenbekov, announced the measures in a decree issued from an undisclosed location and posted on his official website.
But it was unclear whether Mr. Jeenbekov, who went into hiding after violent protests over a disputed parliamentary election on Sunday, would be able to enforce the state of emergency in the absence of a functioning government.
Bowing to pressure from the street, Mr. Jeenbekov earlier on Friday formally dismissed the prime minister, the head of the armed forces and the country’s security chief.
The dismissed officials had already given up their posts and decrees announcing their departure merely acknowledged a fait accompli dictated by the president’s foes.
In a separate statement early on Friday, the president indicated that he, too, could leave office, saying that he was ready to resign once a new cabinet was appointed and “we are back on the path of lawfulness.” His subsequent declaration of a state of emergency, however, suggested he might try to hang on to power, but many welcomed the move as necessary to prevent the turmoil from escalating into a wider conflict. He named a deputy interior minister as “commandant” of the capital, responsible for enforcing the emergency measures.
Mr. Jeenbekov, seeking to reassert his battered authority, reappeared later Friday to attend a meeting in Bishkek with the military leadership and is scheduled to meet with members of Parliament on Saturday to try and hammer out an agreement on a new prime minister.
The prospects of an orderly transfer of power have dimmed in recent days, largely because the opposition is deeply divided. Lawmakers, who have responsibility for naming a prime minister, have held rival meetings in a hotel and cinema but have been unable to agree on a new lawful government that could fill the power vacuum.
On Friday, supporters of two rival would-be new prime ministers — both of whom were freed from prison earlier in the week — clashed violently in Bishkek. The country’s former president, Almazbek Atambayev, who was broken out of jail by protesters and joined the opposition, said he had been the victim of an assassination attempt.
The turmoil in Kyrgyzstan, a former Soviet republic and the only country in Central Asia with a modicum of democracy, follows two months of unrest in Belarus, another former Soviet land, and comes as a military conflict is underway between two other former republics, Armenia and Azerbaijan. The simultaneous crises have blindsided the Kremlin and left President Vladimir V. Putin of Russia scrambling to reassert some order in a zone of influence that Moscow calls its “near abroad” and views as vital to the country’s stability.
Russia has military bases in Kyrgyzstan and also in Armenia, but has so far refrained from flexing its muscle on the ground in favor of one side or another in what are deeply entrenched local quarrels.
The head of Russia’s Federal Security Service, or F.S.B., the main successor agency to the Soviet-era K.G.B., spoke by telephone earlier this week with the acting head of the Kyrgyz security service and offered help to curb the chaos in Bishkek, the capital of Kyrgyzstan. But that Kyrgyz official, Omurbek Suvanaliyev, lost his job on Thursday.
In a separate attempt to rein in the turmoil in former Soviet lands, Russia’s foreign ministry is hosting a meeting in Moscow on Friday between the foreign ministers of Armenia and Azerbaijan over a possible truce in their fighting over the disputed region of Nagorno-Karabakh.
Bishkek fell under mob rule this week after protesters rampaged through buildings housing the Parliament and the presidential administration and stormed detention centers, freeing Mr. Atambayev, two former prime ministers and other detainees.
The violence followed allegations by the opposition of vote buying and other irregularities in parliamentary elections on Sunday that handed victory to pro-government parties. Protesters seized government buildings and Mr. Jeenbekov went into hiding, while insisting he was still running the country.
Mr. Jeenbekov is the second president of a former Soviet republic now struggling to survive after a disputed election. But unlike the authoritarian president of Belarus, Aleksandr G. Lukashenko, Mr. Jeenbekov presides over a country that, at least until Friday’s state of emergency, which imposed restrictions on media, has had a vibrant free press and many opposition parties.
Instead of bringing stability, however, Kyrgyzstan’s relatively democratic system has opened the way to regular bouts of political unrest in a country bedeviled by clan rivalries and deep divisions between north and south.
Two of Mr. Jeenbekov’s predecessors were toppled in violent revolutions and fled abroad to escape arrest. His immediate predecessor, Mr. Atambayev, who is from the north, served out his term but was thrown in jail after leaving office, a fate that Mr. Jeenbekov, a southerner, now wants to avoid.
But securing a deal that guarantees his future freedom will be difficult as Mr. Atambayev, freed from jail earlier this week by his supporters, has been busy rallying opposition to his successor with demands that Mr. Jeenbekov be prosecuted.
Ivan Nechepurenko contributed reporting.