The World Health Organization said it would send a team to Ukraine to assist the authorities.

News reports from the western part of the country said there were long lines at pharmacies as people sought medication and masks.

Image Newlyweds in Lviv, Ukraine, on Saturday. The government has ordered an anti-flu crackdown. Credit... Yuriy Dyachyshyn/Agence France-Presse — Getty Images

With all rallies canceled, the antiflu measures were expected to have an immediate impact on the campaign for Ukraine’s presidency. The election is on Jan. 17, and Ms. Tymoshenko formally registered as a candidate on Saturday.

The virus is spreading across Eastern Europe, but it was not clear why Ms. Tymoshenko chose to undertake stronger moves, like closing schools nationwide, than her counterparts in Russia and Poland.

There were indications, however, that the government’s response was being influenced by electoral politics. Ms. Tymoshenko, one of the leading candidates, and her bitter rival, President Viktor A. Yushchenko, who is far behind in polls in his bid for re-election, both sought to make clear that they were aggressively addressing the outbreak.

On Friday, Mr. Yushchenko criticized Ms. Tymoshenko, saying he had ordered an inquiry into why the country was not, in his opinion, prepared.