As lawmakers discuss a bill to improve the working conditions of foreign trainees in Japan, the first documented case of one such worker dying from "karoshi," or death by overwork, has been confirmed in Japan.

The death of a 27-year-old Filipino in 2014, who was working 78.5 to 122.5 hours of overtime a month, was ruled as death by overwork by the labor ministry's Gifu Labor Standard Inspection Office in August.

It marked the first such case among foreign trainees in Japan after the government began collecting data in fiscal 2011.

Joey Tocnang died of heart failure at his company dorm in Gifu Prefecture in April 2014, three months before his scheduled return to the Philippines.

He hailed from the island of Luzon and came to Japan as a trainee in 2011 to support his family, including his wife, Remy, 28, and 5-year-old daughter, Gwyenth.

At a casting company in Gifu Prefecture, he worked in cutting steel and painting chemicals to a mold in which molten metal is poured.

He was paid a minimum salary by the company and sent most of it to his family in the Philippines.

He looked forward to talking with his daughter through a video phone.

The day before his death, he told a colleague that he would go to a recycle shop to buy her a souvenir.

The office concluded that Tocnang's death most likely resulted from overwork, and sent papers to his relatives last year to claim workers’ compensation.

His wife applied for compensation by presenting a copy of their marriage license and other required documents.

With the ruling in August, his family is entitled to receive 3 million yen ($29,900) in a lump sum payment and about 2 million yen annually in a survivor’s annuity.

Japan introduced the system to accept workers from developing countries as technical trainees in 1993. Trainees can stay in Japan up to three years under the current arrangement.

According to the Justice Ministry, a record 210,000 foreign trainees worked in Japan as of the end of June. The number of such workers shot up in recent years after the administration of Prime Minister Shinzo Abe sought to accept more.

But there have been reports that many of the trainees are treated as cheap labor in industries struggling to meet a shortage of workers.

The Ministry of Health, Labor and Welfare said in a report that of all the companies that have taken in foreign trainees, a record 3,695 were found to have committed violations of the law, such as illegal overtime work, in 2015.

The number was up 718 from 2014.

Data by the Japan International Training Cooperation Organization showed that the deaths and injuries from work-related accidents totaled 1,241 in fiscal 2014, also a record.

Five died in the accidents that occurred during their work, six killed themselves and another six died of heart and brain disorders, the organization said.