The number of foreigners working illegally on farms across the nation rose threefold over the three year period ending in 2015, according to government data.

The findings highlight the difficulties facing Japan's agricultural sector, including labor shortages and the advanced age of many of the country's farmers.

Among all the illegal foreign workers subject to deportation in 2015, the greatest number — 1,744 or 21.9 percent — had worked in the farming sector. That was up from 946 in 2014, 695 in 2013, and 592 in 2012, according to the Justice Ministry.

The ministry also found illegal farm workers were "concentrated on farms in Ibaraki and Chiba prefectures, which are easily accessible from Tokyo."

The average age of the nation's farmers is now 66.4 years old, and the fact so many have no one to succeed them has become a serious social issue.

"I just cannot keep my business afloat unless I hire (illegal laborers), even if it means breaking the law," said a 62-year-old farmer in Ibaraki.

The government does operate schemes under which farmers can legally employ foreign workers, including a technical internship program for people from developing countries. Some 24,000 foreigners were working on Japanese farms as of fiscal 2014 under that on-the-job training program, according to an estimate by the Agriculture, Forestry and Fisheries Ministy.

Since the government began compiling such data in 1991, Tokyo had regularly topped the list of 47 prefectures for the number of foreigners working illegally. But last year, the capital ranked third behind Ibaraki with 1,714 illegal workers and Chiba second with 1,238.

An immigration official said it is believed that around 5,000 undocumented workers are currently working in Ibaraki.

By nationalities, the greatest numbers of illegal workers came from China, Thailand and Vietnam.

The number of foreigners who overstayed their visas rose in 2015. The increase came after the government relaxed visa requirements for visitors from Asian countries.