German President Frank-Walter Steinmeier arrived in Kyiv in a surprise visit early on October 25, his spokesperson said.
Steinmeier, who arrived in the Ukrainian capital by train, was set to meet Ukrainian President Volodymyr Zelenskiy later in the day.
"My message to the Ukrainians is that we are not only standing by your side. We will continue to support Ukraine, economically, politically, and also militarily," Steinmeier said after his arrival.
"It was important to me, especially now in this phase where we are seeing air attacks with drones, cruise missiles, and rockets, to send a message of solidarity to the Ukrainians."
"The people in Ukraine need us," he said.
This is Steinmeier's first visit since Russia began its invasion of Ukraine on February 24, but his third attempt to travel to Kyiv.
Last week, Steinmeier put off a planned trip to Ukraine at short notice, due to security reasons.
The German president had also planned to visit Kyiv together with the presidents of Lithuania, Poland, Latvia, and Estonia in mid-April, but was told not to come at short notice.
Kyiv's decision at that time came amid sustained criticism of Steinmeier's ties to Moscow and his failure while he was Germany's foreign minister to heed warnings from his country's Eastern European neighbors about the threat of Russian aggression.
Steinmeier also angered Kyiv in the days following the Russian invasion by offering only to provide 5,000 helmets as military aid.
Steinmeier previously advocated a policy of “detente” toward Russia, but admitted in the wake of Moscow’s invasion that the policy was a mistake.
Germany has since begun giving Ukraine significant heavy weaponry.