BISHKEK, Kyrgyzstan – Mobs of armed men torched Uzbek neighborhoods on Friday in ethnic clashes that officials said left at least 45 people dead and 637 wounded in this Central Asian nation, which hosts U.S. and Russian military bases.

The rioting in Osh, the country’s second-largest city, is the worst violence since former President Kurmanbek Bakiyev was toppled in a bloody uprising in April and fled the country. The unrest also spread to the capital, where armed mobs clashed with police and volunteer militia, witnesses said.

The intensity of the conflict, which pits ethnic Kyrgyz against minority Uzbeks, appeared to take authorities by surprise and threw the fragile interim government’s prospects for survival into doubt.

Quelling the violence will prove a decisive test of the government’s ability to control the country, hold a June 27 vote on a new constitution and go ahead with new parliamentary elections scheduled for October.

Dozens of buildings across Osh were ablaze Friday after witnesses reported sustained gunfire beginning late Thursday. Gangs of young men armed with metal bars and stones attacked shops and set cars afire.

The interim government declared a state of emergency in Osh and some nearby areas and dispatched armored vehicles, troops and helicopters to stop the violence. Soldiers were posted on routes into the city and at major intersections, but the fighting did not abate. Authorities imposed an 8 p.m. to 6 a.m. curfew until June 20.

Bakyt Omorkulov, a member of the Coalition for Democracy and Civil Society, a nongovernmental organization, said he was patrolling the streets with other volunteers to try to prevent further clashes. He said the troops’ presence didn’t stabilize the situation, and more buildings were set ablaze as night fell.

Bakiyev is believed to be in exile in Belarus, but interim authorities accuse his supporters of trying to foment unrest.