The Spanish government has abandoned its plans to tighten the country’s liberal abortion laws, ending months of speculation and prompting the resignation of the justice minister charged with enacting some of the toughest legislation on the issue in Europe.

“As president of the government I have taken the most sensible decision,” the country’s prime minister, Mariano Rajoy, told reporters at a conference in Madrid, saying that his government had failed to reach consensus on the issue. “We can’t have a law that will be changed when another government comes in.”

The changes would have made Spain one of the toughest countries in Europe in which to get an abortion.

Rajoy said his government would instead seek to reform the law introduced in 2010, so that 16- and 17-year-olds would need their parent’s permission to have an abortion. The reform would be introduced by the end of the year, he said.

Hours after Rajoy’s remarks, the justice minister, Alberto Ruiz-Gallardón, announced his resignation, saying that he had been unable to turn the government’s plan into law.

Last December, the conservative People’s party (PP) announced plans to tighten the country’s liberal laws by making abortion illegal except in the case of rape or when there was risk to the mother’s physical and mental health. Women wanting an abortion would have needed two doctors to verify those conditions.

Tens of thousands rallied against the changes, taking to streets across the country to protest against what they called a step backwards. Polls showed that between 70% and 80% of the population was opposed to the idea.

On Tuesday some people who voted for the PP expressed their disappointment with the government’s refusal to push through the changes and vowed to withhold their votes from the party. Pointing to the thousands who rallied on Sunday in Madrid in support of stricter abortion laws, Right to Life’s spokeswoman, Gádor Joya, accused Rajoy of “spitting in their face”.

“We’re announcing that there will be many more protests in the street. If Rajoy wanted to silence Spaniards with this announcement, he is mistaken because this will have the contrary effect.”

Many others celebrated the news. “This is good news for Spanish society and women,” said Isabel Serrano, a spokeswoman for Decidir Nos Hace Libres, a platform made up of hundreds of groups across the country opposed to the tightening of abortion laws. “The law was out of touch with reality and the will of Spaniards, as well as with the European context in which we live.”

The Rajoy government, she said, should pay a political price for casting women’s rights as a tool to be used for political purposes. “They’ve done a lot of damage. Spain was often seen as similar to other progressive countries in Europe and now we’ve lost that image,” she said. “Someone should pay for that.”