The announcement comes after the deadly floods in the country, and means that people will be able to avoid going to work when there is extreme weather.
After the floods a month ago, where more than 220 people died, several companies have been criticized for ordering their employees to continue working despite a red warning being issued by the country's meteorological institute.
According to Spain's Labour Minister Yolanda Díaz, the new leave aims to "ensure that no worker is exposed to risks", she tells the Spanish public service company RTVE. If authorities warn of risks, "the worker must refrain from going to work", says Díaz.
There are similar laws in Canada, and the Spanish rules are inspired by them.