“This war took the best heroes of our country,” During an unannounced trip to Kherson, President Volodymyr Zelensky of Ukraine spoke.CreditCredit…Finbarr O’Reilly, Sunday Review

KHERSON, Ukraine — President Volodymyr Zelensky of Ukraine made an unannounced visit to the newly freed city of Kherson on Monday, reveling in perhaps the most significant success by his country’s forces since Russia’s full-scale invasion began in February.

“This is the beginning of the end of the war,” He addressed a crowd of hundreds, some of them wrapped in Ukrainian flags.

The president’s visit to Kherson just days after it was retaken was a tangible sign of Ukraine’s soaring morale and its growing boldness in the nearly nine-month war. Kherson was a key Black Sea port and gateway to Crimea. It was the first major city that fell to Russian forces following the invasion of February 24. Russia’s decision to withdraw was a major blow to the Kremlin and its ambition to conquer all of southern Ukraine.

There were also clear reminders that the conflict was not over. While he was talking, explosions — possibly Ukrainian forces deactivating mines — echoed in the distance. Another reminder of the imminent threat to the civilian population was the presence of Russian forces nearby, across Dnipro River.

The daring nature and bravery of the visit was evident when Mr. Zelensky found himself surrounded by police officers and soldiers with rifles.

The crowd cheered and shouted in unison. “glory to Ukraine.”

He wore a hooded parka with cargo pants, and seemed a little bleary-eyed but determined. He spoke in front a Kherson regional administration building where, just a few weeks ago, the tricolors representing Russia were visible above the imposing facade.

Andriy Yermak, the head of the Mr. Zelensky’s office, posted a video of the Ukrainian flag being raised above the city.

Russia took control of the Kherson area in March during the conflict. Last week, the Kremlin ordered the withdrawal of its forces as Ukraine’s military bore down on the city, and later took control. The Ukrainian troops arrived in triumph, to be welcomed by the remaining population.

Ukraine has taken back territory in the east and the south since September.

He stayed only for about 10 minutes. The crowd continued to gather after Mr. Zelensky left.

There was a satellite dish in the square. Many people tried to reach their loved ones.

26-year-old Alina Samofalova worked at a Kherson human resource agency and was wearing a yellow flag and blue flag over her shoulders. She arrived on the main square Monday morning, unaware that Mr. Zelensky was already there.

“I am so excited he came,” Ms. Samofalova’s nails were yellowed, she said. “When the orcs were here, it was a gray mood like a black-and-white movie,” She used a common insult to refer Russian soldiers, she said.

“Now, it is like the sun is shining over the city.”

Ukrainian officials have requested that people leave the city until it is safe and all essential services are restored.

Ms. Samofalova claimed that she visited the square due to its energy. According to Ms. Samofalova, the fact that Mr. Zelensky was willing to risk his own safety sent an important message.

“When the government and president come to hear our problems,” She said: “they seem close to the people.”

Marc Santora, Matthew Mpoke Bigg And Oleksandra Mykolyshyn Contributed reporting