Belgrade (AFP) - Serbia declared a state of emergency Sunday to halt the spread of the new coronavirus, shutting down many public spaces, deploying soldiers to guard hospitals and closing the borders to foreigners.

Serbia's President Aleksandar Vucic said the new restrictions were necessary to "save our elderly" in the Balkan state of some seven million, which has detected around 50 infections of COVID-19 so far with limited testing.

"From tomorrow, there is no more school, no nurseries, no universities, everything closes, no training, sports... we will close down to save our lives, to save our parents," he said.

The military would be mobilised to guard "important sites" like hospitals where coronavirus patients were being treated, he added.

The decree does not go as far as draconian lock-down measures imposed in the worst hit European countries, Italy and Spain, where hundreds have died.

Vucic implored only those over the age of 65 to stay inside. The specifics of the new restrictions, such as opening hours for cafes and bars, would be hammered out in a government meeting, he said.

"I say to foreigners: don't come to Serbia, except for the Chinese who are called upon to come, their doctors, the people who help us," Vucic added.

The president, who is trying to lead Serbia into the European Union but has also fostered warm ties with Beijing, said China's help was crucial amid a lack of "European solidarity".

The country's Prime Minister Ana Brnabic confirmed that Serbia's borders would be closed to all foreigners "tonight" (Sunday), apart from diplomats and full-time residents.

Serbian nationals returning from outbreak hotspots will be quarantined from between 14 to 28 days, she added.

Those who violate the terms of the quarantine could face up to three years in prison.