Photo/IllutrationThe Tokyo Regional Immigration Bureau, located on the fringes of Shinagawa along Tokyo Bay, serves foreign residents and long-term visitors to Japan. (Photo by Lisa Vogt)

The number of foreign residents in Japan surged 7.5 percent to 2,561,848 last year for a third consecutive record high, fueled by increases in students and technical intern trainees, the Justice Ministry said.

The figure, as of the end of 2017, was a year-on-year rise of 179,026 people, the ministry said March 27.

The total includes special permanent residents and foreign citizens with permission to stay in Japan for more than three months.

The number of people who came to Japan to either study or join the technical intern trainee program increased by around 40,000 each last year.

The largest group by nationality or region was China, with 730,890 people, followed by 450,663 from South Korea.

Vietnamese accounted for 262,405 of the total, a jump of 31.2 percent from the previous year, while 80,038 people were Nepalese, up 18.6 percent, the ministry said.

However, the number of people staying in Japan illegally also rose. According to the ministry, 66,498 people were here illegally as of Jan. 1, up by 1,228 from the same period in 2017.