BUENOS AIRES (Reuters) - Argentina will begin a mandatory quarantine, President Alberto Fernandez announced on Thursday, the South American nation's latest measure to curb the spread of coronavirus.

The quarantine, which restricts people to their homes, will be in effect from midnight on Friday morning until March 31, Fernandez said in a televised address.

People will be able to leave their homes to shop for basic goods, like food and medicine. The quarantine will be enforced by security officials, Fernandez said.

"It is time for us to understand that we are caring for the health of Argentines. We have now dictated this measure trying to make the effects on the economy as least harmful as possible.

Argentina confirmed 31 new cases of coronavirus, bringing the total cases to 128, and three deaths, according to government data.

The country had already closed its borders for a total of 15 days to non-residents and suspended flights from highly affected countries for 30 days.

(Graphic: Argentina coronavirus cases link: https://fingfx.thomsonreuters.com/gfx/editorcharts/ARGENTINA-DEBT/0H001R8GJCC8/eikon.png).

(Reporting by Nicolas Misculin; writing by Cassandra Garrison; editing by Chris Reese and Sandra Maler)