Spain's Cabinet on Tuesday approved a draft bill giving workers the right to take sick leave due to severe period pain.
Adopting the legislation would make Spain the first country in Europe with such a law.
Women in Spain will have the right to stay at home for as long as the pain lasts. The estimated costs of €23.8 million ($25 million) per year are to be covered by the state.
A consultation with a doctor is required to get the time off work.
"We are making a law that will ensure that women can live better," Equality Minister Irene Montero told reporters after the Cabinet meeting.
"It's an end to working in pain and popping pills."
The bill will not be ready to be presented to parliament until consultations are completed. Constitutional experts say the law will not come into force before the end of 2022 at the earliest.
Montero, from the smaller Unidas Podemos (United We Can) party in Spain's left-wing coalition, is one of the main forces behind the bill.
It is due to be introduced alongside new regulations on abortions, which will allow all over 16s to terminate a pregnancy without parental consent.
Some lawmakers from Prime Minister Pedro Sánchez's Socialist Party, which leads the minority government, had expressed reservations about the bill.
Economy Minister Nadia Calviño warned the regulation could put women at a disadvantage when competing for jobs.
The government would never approve measures that could "stigmatize women," she said.
Comparable regulations exist in Taiwan, where women can be absent from work for three days per year due to period pain, but they only receive half their salary for the days off.
In South Korea, employers must give female workers one day off per month if they make a claim, but the law does not specify who pays the costs or whether wages should be paid.