It was his first official trip outside the Kyiv region since the Russian invasion began on 24 February.
Ukraine's President Volodymyr Zelensky has left Kyiv to visit his troops in Kharkiv region of Ukraine.
BBC reported that this is his first official trip outside the Kyiv region since the Russian invasion began on 24 February.
He was pictured in a bullet-proof vest surveying ruins in Kharkiv city.
Mr Zelensky told soldiers, "I want to thank each of you for your service." Later, he sacked the local security chief for "not defending" the city.
Russia has resumed shelling Kharkiv - Ukraine's second-largest city - in recent days after a fortnight of comparative quiet.
The city - Ukraine's second-largest - faced intense bombardment in the war's first months, with images showing tower blocks flattened to rubble.
Russian troops were gradually pushed back from its surrounding towns during April and May, prompting some who had fled Kharkiv to return, and the metro to reopen for the first time since the invasion.
But the city remains within range of Russian artillery. Several loud explosions were heard in the city after Mr Zelensky's visit.
President Zelensky's office posted a video on Telegram with the caption: "2,229 buildings have been destroyed in Kharkiv and the region. We will restore, rebuild and bring back life. In Kharkiv and all other towns and villages where evil came."
The president also visited the city of Kharkiv, which was bombarded day and night in the war's early months
The footage featured Ukrainian soldiers giving Mr Zelensky a tour of the damage wrought by the war, including broken down trucks by the side of a road.
"In this war, the occupiers are trying to squeeze out at least some result," Mr Zelensky posted later.
"But they should have understood long ago that we will defend our land to the last man. They have no chance. We will fight and we will definitely win."
The president said he had fired Roman Dudin, the chief of the Security Service of Ukraine for the Kharkiv region "for the fact that he did not work on the defence of the city from the first days of the full-scale war, but thought only about himself".
"On which motives? The law enforcement officers will figure it out," he added.
The president met Kharkiv's mayor and the regional governor to discuss reconstruction plans, reportedly urging them to "find cool projects" to help rehabilitate the ravaged city.
"This is a chance for such districts to have a new face," Mr Zelensky said.
His chief of staff, Andriy Yermak, said 31% of the Kharkiv region's territory was currently occupied by Russia, while 5% had been re-taken by Ukraine after being occupied earlier.
Russia is presently concentrating its offensive on the Donbas region in eastern Ukraine, which it has vowed to seize as a key war aim.
Russian forces are trying to encircle the cities of Severodonetsk and Lysychansk. On Saturday Russia's defence ministry said it had taken the nearby town of Lyman, in Donetsk - part of the overall Donbas region.
"The situation is very difficult, especially in those areas in the Donbas and Kharkiv regions," Mr Zelensky said on Saturday in his daily address to the nation.