Madrid (CNN) The European Union will close its borders to all non-essential travel as it attempts to contain the ongoing spread of the coronavirus on the continent.

"The less travel, the more we can contain the virus," European Commission President Ursula von der Leyen said Monday following a video conference between G7 leaders. She appeared confident that the European Council would sign off on the restriction in a Tuesday vote.

The bloc's member states imposed aggressive measures on Monday, days after the World Health Organization (WHO) said Europe was at the epicenter of the pandemic.

French President Emmanuel Macron declared "war" on the virus during a national address on Monday, banning all social events across the country -- including family gatherings.

Macron said those who have gathered in public places in recent days have not been respecting previous measures to limit the outbreak's spread in France, which as of Monday had 5,380 confirmed cases and 127 deaths, according to the WHO.

Germany also announced new restrictions on public life, closing bars, clubs, discos, and similar establishments, as well as theaters, opera houses, concert halls and museums.

"These are measures that have never existed in our country before, but they are necessary," German Chancellor Angela Merkel said Monday during a press conference.

Supermarkets, pharmacies, gas stations, hair salons and launderettes will remain open, according to a government statement.

Commission President von der Leyen said the EU travel restrictions would be in place "for an initial period of 30 days," and could be prolonged.

Family members of European nationals, essential staff, such as doctors and nurses, and people transporting goods to the EU will be exempted, she added.

Spanish lockdown

News of the extraordinary measures came as Spain went into partial lockdown in an attempt to stem the worst coronavirus outbreak in Europe after Italy.

Spain's recorded cases of the virus surged by 1,400 overnight, to a total of 9,190, with 309 deaths, its Health Ministry said. Meanwhile Italy has over 24,000 cases and more than 1,800 deaths, according to the WHO .

The country's land borders were closed Monday, Interior Minister Fernando Grande-Marlaska announced. The closure does not include Spanish nationals and residents, workers required to cross the border, and the transport of goods.

Some 47 million Spanish residents have been banned from leaving their homes -- with the exception of those going to work, buying food, going to a hospital, or supporting an elderly person or child in their care.

A member of the Spanish Military Emergency Unit (UME) stands guard near Madrid's Atocha train station on Sunday.

The few people still walking in Madrid's eerily empty parks on Monday were met by buzzing drones overhead, instructing them to: "Go home!"

Priests in the deeply Catholic country are celebrating Mass alone, with services shown only on TV or via social media. Restaurants and bars have been closed. And cultural sites like the Prado Museum and Royal Palace in Madrid are also shut, as part of the tough measures announced by Spanish Prime Minister Pedro Sanchez on Saturday.

The same day, the government announced that the prime minister's wife, Maria Begona Gomez Fernandez, had tested positive for the virus. The couple are both "well" and following preventative measures at their official residence, La Moncloa Palace in Madrid, the statement added.

Spanish Prime Minister Pedro Sanchez and his wife Maria Begona Gomez Fernandez in October last year.

Spain's 15-day state of emergency comes after school closures were announced last week.

Tougher measures are expected to follow after the health ministry identified a 25% daily increase in the number of cases, its emergencies coordinator, Fernando Simon, said Monday.

Metro falls silent but commuter trains packed

Around half of the cases reported in the country so far have been in Madrid, where the region's president, Isabel Diaz Ayuso, has also tested positive for the virus, officials said.

🚇 Metro ha sacado el 100% de los trenes de un día laborable habitual y ha habido en hora punta un 75% menos de viajeros que el lunes pasado. Este es el aspecto general a las 7:50. pic.twitter.com/LnukaCgYBQ — Metro de Madrid (@metro_madrid) March 16, 2020

Streets and metro stations in the capital remain all but empty. Madrid's Metro posted CCTV images of deserted platforms Monday morning, adding that it had seen 75% fewer commuters than during rush hour last week.

It was a different story on the trains however, which passengers from out of town rely on to get into the city. At the central Atocha train station, commuters lined the platform and many told CNN that safe distances were not being maintained on board.

Commuters on a busy train at Madrid's Atocha train station.

"It's shameful," passenger Librada Aguilera told CNN. "There are fewer trains which means they are very full. I had to travel with people all around me, very close."

"What is the point of me being at home all weekend if I am going to have to travel like this today?" she asked, adding that a "safe distance" was not being implemented.

"I can't work from home, so I don't have another option but to travel like this," she said.

Elsewhere in the city, some supermarkets were going to extremes to stop customers standing too close to one another, by taping markings on the ground.

Supermarkets were largely empty on Monday, with cashiers changing their gloves and disinfecting conveyor belts after every every customer, CNN reporters found.

At a supermarket in central Madrid, lines taped on the ground indicate how far apart customers should stand.

"Most Spaniards are compliant" with the restrictions, one police officer patrolling the streets of Madrid told CNN. "Though they are taking far too much time to walk the dog or shop for food," he said, adding that this was "a trick" to stay outside for longer.

To get people off the streets, police can issue fines starting at $100. But the officer admitted that "fines won't solve this."

"We all have to do this in solidarity, knowing that everyone is staying at home," he said.

Militares de la Brigada Paracaidista @EjercitoTierra trasladan al Hospital de Alcalá de Henares #Madrid 45 camas cedidas por dos hoteles de la ciudad #EsteVirusLoParamosUnidos pic.twitter.com/j6vqRvDl1v — Ministerio Defensa (@Defensagob) March 16, 2020

Some hotels have offered up their beds to help ease the strain on hospitals. On Monday, the country's Parachute Brigade delivered 45 hotel beds in army trucks to Alcalá de Henares in Madrid.

Elsewhere, high-profile budget airlines Ryanair and Easyjet announced on Sunday they would be canceling and reducing flights to and from Spain.