Workers preparing the Wuhan International Conference and Exhibition Center on February 4, 2020 in Wuhan, China. It is understood that the first and second floors of Wuhan International Convention and Exhibition Center have been converted into temporary hospitals with a total of 1,000 beds, which are specially used to treat patients with mild new-type coronavirus.

The coronavirus has killed two foreigners in China — a U.S. citizen and a Japanese national, the country's Ministry of Foreign Affairs said on Monday.

In total, there were 27 confirmed foreign cases in China as of 8 a.m. Monday local time, the ministry's spokesman Geng Shuang said, according to an official translation. He added that three foreigners have recovered and were discharged.

The announcement came as China's National Health Commission said there were 3,062 new cases and 97 additional deaths, mostly in Hubei province, as of Sunday night. That brings the total confirmed cases in mainland China to 40,171 including 908 deaths, the government said.

The U.S. citizen diagnosed with the new coronavirus died in Wuhan, China on Thursday, the U.S. embassy said in a statement to CNBC over the weekend.

"We can confirm a 60-year old U.S. citizen diagnosed with coronavirus died at Jinyintian Hospital in Wuhan, China on February 6. We offer our sincerest condolences to the family on their loss. Out of the respect for the family's privacy, we have no further comment," the embassy said.

It was the first known American death in the outbreak. Wuhan, the center of the outbreak and the capital of Hubei province, is where most deaths and confirmed cases are located.

Meanwhile, the Ministry of Foreign Affairs of Japan said in a statement on Saturday that a male Japanese patient with "severe pneumonia" had died while he was hospitalized in Wuhan, China.

The ministry said the hospital suspected that the patient had contracted the new coronavirus, but that it wasn't confirmed.

— CNBC's Christine Wang contributed to this report.