TOKYO -- In a move to encourage more foreigners to stay in Japan, a new law enacted here on Friday made it a requirement for businesses to make an effort to provide foreign employees with opportunities to learn the language.

The legislation also commits national and local authorities to promoting Japanese-language education.

The move comes as Japan opens its doors to foreign workers in greater numbers, hoping to ease a labor shortage. The number of foreign residents reached a record high of about 2.73 million at the end of last year, and more are set to arrive following new rules that allow such employment in a broader range of jobs and let certain workers bring their families to the country.

But these inflows have outpaced the growth of opportunities to learn the language. The number of Japanese learners rose 72% over five years to about 240,000 in fiscal 2017, but teachers of the language increased only 15% to about 40,000, data from Japan's Agency for Cultural Affairs shows.

There are worrying signs that new arrivals are slipping through cracks in the system. A little over 1,600 foreign students at the Tokyo University of Social Welfare were revealed recently to have gone missing, resulting in the school being barred from accepting new students.

The legislation was initiated by lawmakers rather than the cabinet, which typically submits bills to the parliament. The new law seeks to address the shortage of opportunities to learn Japanese by placing more educators in schools and promoting teacher training for community classrooms. Companies also will be required to make efforts to provide educational support for workers' families.

"It's very significant that a legal backing has been established for promoting Japanese-language education," said Uichi Kamiyoshi, a Musashino University professor who was a proponent of the bill. "This will make it easier for municipalities to budget for relevant programs. Hopefully, it will also lead to steady employment and better pay and benefits for Japanese-language teachers."