“The events of the last months have pushed us into a real war, albeit an undeclared one,” Mr. Poroshenko said in the speech commemorating Ukraine’s emergence from the wreckage of the Soviet Union. “Over the last six months, a new Ukrainian Army has been born in heavy and exhausting fighting.”

Crowds waved flags along the route of the military parade, the first in Kiev since the former president, Viktor F. Yanukovych, suspended the Soviet-inspired tradition in 2009. Onlookers cheered and applauded as soldiers marched through Independence Square, which until recently was the site of a protest encampment set up last year at the start of the uprising that toppled Mr. Yanukovych in February.

His political stronghold was in the predominantly Russian-speaking east, and his ouster precipitated an armed revolt there, centered in his hometown, Donetsk. This city is now encircled by Ukrainian troops who are pushing to regain control.

Mr. Poroshenko said in his speech that Ukraine, which is nearly bankrupt, would spend nearly $3 billion over the next three years to re-equip its army. “It is clear that in the foreseeable future, unfortunately, a constant military threat will hang over Ukraine,” he said.

The president’s comments appeared to signal Ukraine’s determination to fight on, despite warnings from Chancellor Angela Merkel of Germany that the crisis in the east could not be solved by force alone, and despite a call on Sunday from the International Committee of the Red Cross for an end to the shelling of civilian areas. The fighting has killed more than 2,000 people, and nearly 300 died when Malaysia Airlines Flight 17 was shot down in eastern Ukraine last month.