MOSCOW — The president of Kyrgyzstan was forced to flee the capital, Bishkek, on Wednesday after bloody protests erupted across the country over his repressive rule, a backlash that could pose a threat to the American military supply line into nearby Afghanistan.

Opposition politicians, speaking on state television after it was seized by protesters, said they had taken control of the government after a day of violent clashes that left more than 40 people dead and more than 400 wounded. The instability called into question the fate of a critical American air base in the country.

Riot police officers fired rounds of live ammunition into angry crowds of demonstrators who gathered around government buildings to rally against what they termed the government’s brutality and corruption, as well as a recent decision to increase utility rates sharply. Witnesses said that the police seemed to panic, and that there was no sign of supervision. In several cases, demonstrators wrested their weapons away from them.

By early Thursday morning, opposition officials occupied many government buildings in Bishkek, and were demanding that the president, Kurmanbek Bakiyev, sign a formal letter of resignation. Mr. Bakiyev has issued no public remarks since the protests began. An official at the Bishkek airport said Mr. Bakiyev was flying to Osh, a major city in the southern part of the country.