BERLIN - Germany's population rose to an all-time high of 84.3 million people in 2022, after stagnating over the past three years, as Ukrainian refugees came to Germany fleeing the war.

In 2022 there were 1.1 million more people living in Germany than in the previous year, the federal statistics office said on Thursday. Immigrants more than compensated for a low birth rate and ageing population.

In just the first half of the year, Ukrainians arriving in Germany swelled the population by 740,000. At the peak of the earlier refugee crisis prompted by violence in Syria, Afghanistan and Iraq, in the second half of 2015, Germany added 756,000 new residents.

The flow of immigrants coming from countries other than Ukraine also increased in 2022, following years of sluggish growth due to the COVID-19 pandemic, the statistics office's data showed.

The balance between the number of immigrants and emigrants was at its highest level since Germany started collecting the statistics in 1950, and four times higher than in the previous year, the statistics office said. The arrival of immigrants of working age compensated for the ageing of the population. While the overall proportion of Germans of working age (15 to 63 years) was 61.6% in 2022, it was 75.9% among people coming from abroad.

(Reporting by Maria Martinez, editing by Rachel More and Alex Richardson)