MADRID — Prime Minister Mariano Rajoy’s proposal to enact some of the toughest abortion restrictions in Europe has exposed his already unpopular government to a building political backlash and criticism from the European Parliament, while reinvigorating his Socialist opponents and opening divisions in his own conservative Popular Party.

On Sunday, demonstrators gathered in downtown Madrid to protest the government’s health care cuts and the abortion proposal, which was introduced in December and would allow the termination of a pregnancy only if it was the result of rape or if having the baby would significantly endanger the mother’s health. It would not allow abortions if the fetus was deformed.

“Those who give birth should be deciding,” said Pilar Gómez, an administrator of the Los Yébenes health care center in Madrid. “After all the advances that we had made, we’re now being taken right back to the days of Franco.”

The current abortion law, adopted under the previous Socialist administration, allows women to end a pregnancy within the first 14 weeks and beyond that period in cases of life-threatening problems related to the fetus.