KYIV, Ukraine—The news that Boris Johnson will resign disappointed many in Ukraine, where the British prime minister has won countless fans—from the country’s leaders to ordinary citizens—for his support for Kyiv’s fight against Russia’s invasion.

Since the start of the war, Mr. Johnson’s government has given a total of £3.8 billion, equivalent to $4.6 billion, in military and economic support to Ukraine this year, second in value only to the U.S.

Mr. Johnson used his resignation announcement Thursday to tout some of his government’s achievements, including its strong support for Ukraine. Following his move, a Downing Street spokeswoman said Mr. Johnson spoke with Ukrainian President Volodymyr Zelensky to emphasize the U.K.’s “cross-party support” for Ukraine and assured Mr. Zelensky that aid would continue “for as long as needed.”

In turn, Mr. Johnson earned plaudits at home for his government’s deep support for Ukraine’s fight against Russian forces. Indeed, Defense Minister Ben Wallace is considered a candidate to replace Mr. Johnson, in part due to the popularity of the military and political support the government has offered to Ukraine.

Mr. Zelensky said Ukrainians were saddened by Mr. Johnson’s resignation. “We are sincerely grateful for the decisive and uncompromising help from the first days of the war,” he said on his official Telegram channel. “We have no doubt that the UK’s support will continue.”

In the lead-up to the war, the hashtag #GodSaveTheQueen was trending in Ukraine on Twitter.

For Ukrainians, Britain’s support has translated into widespread admiration for Mr. Johnson, particularly as other allies, including Germany and France, were initially viewed here as reluctant to offer heavy military weapons in assistance to Ukraine.

In May, the Ukrainian town of Fontanka, a suburb of the port city of Odessa, named a street after Mr. Johnson.

He was one of the first Western leaders to visit Kyiv in the days following the invasion, even as his government battled scandal at home. His trip through the fortified streets of Kyiv alongside Mr. Zelensky was viewed across Ukraine as a bold show of solidarity.

Ukrainian troops also have started training in the U.K. after Mr. Johnson offered to launch a major operation with the potential to train up to 10,000 soldiers every 120 days.

“I like Boris Johnson very much,” said Yevgeny Bushkar, 34, an architect in Kyiv. “He helped us, he helped Ukrainians.”

Mr. Johnson’s downfall stemmed in part from a series of events held at Downing Street in violation of the government’s own Covid-19 lockdown rules. Mr. Bushkar described those scandals as “stupid” and “an excuse to get rid of him.”

Viktor Pavlyuk, 36, a native of Bucha, a suburb of Kyiv, said British assistance has been imperative to defending major cities across the country.

“Life is almost back to normal in Kyiv,” Mr. Pavlyuk said, who now lives in the Ukrainian capital. “This is because of his help, and the Americans and other allies. But especially U.K.”

Write to Vivian Salama at vivian.salama@wsj.com