Foreigners make up roughly 3.5% of Japan's total population. (EPA Images pic)TOKYO: Japan has registered a record number of foreigners living in the country this year despite growing anti-immigration sentiment, as the country grapples with problems caused by an ageing and shrinking population.

Data showed 4.28 million foreigners staying in Japan as of the end of June, excluding short-term visitors, the Immigration Services Agency said on Friday.

That marks an increase of 156,000 people from the end of last year, and accounts for roughly 3.5% of Japan's total population, according to calculations based on government estimates.

Immigration expert Toshihiro Menju told AFP that Japan is facing a labour shortage on all levels, from highly skilled professionals to service workers.