As it recovers gradually from the pandemic, it is putting in place measures to prevent the resurgence of the virus.
Spain has made mandatory face masks wearing on public transport.
The directive is to take effect from Monday, April 4, 2020.
The directive comes as Spain relaxes its lockdown gradually.
Prime Minister Pedro Sanchez announced that the Spanish government would distribute 6 million masks, mainly at transport locations, and give another 7 million to local authorities.
Adults in Spain have been able to exercise outdoors on Saturday for the first time in seven weeks.
The lockdown was eased for children under 14 a week ago.
Spain’s official death toll is 24,824, but the rate of fatalities has dropped.
Italy has Europe’s highest death toll, followed by the UK and Spain.
Italy announced another 474 deaths on Saturday, a larger number than in recent days, but according to La Repubblica that figure includes 282 deaths outside of hospitals in April which were not included in earlier figures.
Mr Sanchez said Spain was now reaping the rewards of the sacrifices made during the lockdown, one of Europe’s strictest.
He also said his government would approve a €16bn ($17.6bn; £14bn) fund to help regional authorities deal with the economic damage inflicted by the coronavirus pandemic.
In Madrid, residents voiced relief to be finally exercising outdoors. “Happy, we feel free!” Susana Piego told Reuters.
Jesus Gutierrez said “it’s basic, for physical and mental health, it is basic to allow people to do sport”.
Since 14 March people have only been allowed to leave the house to buy food or medicine, to go to work if working from home was not possible, or to briefly walk the dog.
There are now exercise slots for different age groups, and the amount of outdoor exercise time remains limited. Most adults can walk or play sports between 06:00 and 10:00, and between 20:00 and 23:00.