This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

MADRID (AP) — The Spanish government on Tuesday passed a law giving hundreds of thousands of domestic cleaners and carers the right to unemployment benefits and other job protection measures for the first time.

Labor Minister Yolanda Díaz said the law would benefit more than 370,000 people, 95% of whom are women. She said the bill was intended to end discrimination against workers whose jobs have been undervalued for too long.

“If there is a job in our lives that is important it is that of caring and cleaning, and for that reason I think today the country is better off,” said Díaz.

The law will take effect in October.

Prime Minister Pedro Sánchez announced Monday that the bill would be passed at the Cabinet meeting Tuesday, saying it was to “put an end to unacceptable injustice.”

Díaz said the law follows long-standing recommendations from both the European Union and the International Labor Organization that people employed in private houses should have the same rights as other workers.

Díaz said that a third of the cleaners and carers were more than 50 years of age. More than 40% are foreigners, principally from Colombia, Romania and Honduras.

Unions and domestic worker collectives have long campaigned for the bill. They argued that most house cleaners and carers had no social or labor protection and often worked up to 60 hours a week. They could also be fired without notice or justification.