Government officials said the riots were aimed at acting President Kurmanbek Bakiyev, seen as the frontrunner in polls called after he spearheaded a successful coup in March.
More than 1000 policemen on Friday drove the supporters of would-be opposition candidate Urmatbek Baryktabasov out of the building in the capital, Bishkek, and chased them through nearby streets, shooting in the air and firing teargas.
Election authorities have barred Baryktabasov, saying he is a citizen of neighbouring Kazakhstan.
Another crowd of about 500 protesters formed a line on the central Chui Avenue, which runs past the main government building, whistling and jeering at police.
"This chaos must be brought to an end," Felix Kulov, first deputy prime minister, said after the rioters were expelled.
Kulov, a political leader who was sprung from jail during the coup that drove former president Askar Akayev into exile in March, is running on Bakiyev's slate in the elections.
"Many oppose my partnership with Bakiyev and ... say that this is not a partnership at all but a freak show, that our union is against the people," he added.
Bakiyev and Kulov were previously political rivals, but formed an alliance saying they wanted to avoid further divisions in the five-million-strong Central Asian nation, which has been unstable since Akayev's ousting.
Worries over instability grew after the bloody suppression of an uprising in neighbouring Uzbekistan last month.
Hundreds of people were killed when troops fired on demonstrators in the town of Andijan, and dozens of refugees fled into Kyrgyzstan.
Anti-riot police recaptured the
The protests in Bishkek brought back memories of the two days of looting that followed the coup and left the capital strewn with broken glass from gutted shops.
The government has deployed troops to tighten security.
"I can officially declare that this will not be repeated and there will be no new robbing spree," Kulov said.
Parliament has called an emergency meeting to discuss the situation, which will be attended by Bakiyev and Kulov, parliamentary sources said.
The head of the central electoral commission, Tuigunaaly Abdraimov, said the riots could complicate polls, due on 10 July.
He later returned to his office, which officials had earlier fled when more than 150 protesters broke in.
The seizure of the building came after more than 1000 people rallied in Bishkek's main square to protest against the decision by election authorities not to register Baryktabasov. The officials said they would not reconsider their decision.
Baryktabasov has been officially barred from running because he has a Kazakh passport.