The number of foreign workers in Japan as of the end of last October topped 2 million for the first time, government data showed Friday, as the country grapples with labor shortages amid an aging population.

The rise to a record 2,048,675 foreign workers, up 225,950, or 12.4 percent, from the previous year, was also due to a recovery in the number of technical interns following the end of Japan's strict coronavirus border controls.

The foreign worker population has logged consecutive annual highs since 2013, but last year's increase dwarfed the 5.5 percent rise in the previous year.

The number of workplaces employing foreign nationals climbed 6.7 percent to a new high of 318,775, as firms increase hiring to cope with labor shortages.

"With the construction and medical and welfare sectors hiring more (foreign workers), the rate of increase has come close to pre-pandemic levels," a labor ministry official said.

By nationality, Vietnamese workers accounted for the largest proportion, at 518,364 people, accounting for 25.3 percent of the total.

They were followed by Chinese at 397,918 people, or 19.4 percent, Filipinos at 226,846 people, or 11.1 percent, and Nepalese at 145,587 people, or 7.1 percent.

By residency status, specialist and engineer visa holders rose 24.2 percent to 595,904 people, while technical interns were up 20.2 percent to 412,501 people, marking the first increase in three years.

The rebound in people working under the technical internship program comes as the government considers scrapping the controversial scheme, which has been criticized as a front for importing low-cost labor.

Conversely, the number of holders of the designated activities visa that applies to various residency types including individuals working while studying Japanese fell 2.3 percent to 71,676 people.

By location, Tokyo had the largest foreign worker population at 542,992 people. It was followed by Aichi Prefecture in central Japan at 210,159 people and Osaka Prefecture in the country's west with 146,384 foreign workers.

Related coverage:

Vietnamese trainees told to undergo contraception to work in Japan

FOCUS: Tokyo bus operator banks on foreign drivers as shortage looms

FEATURE:Municipalities help local firms beat big rivals to Asia's IT talent