Spanish MPs narrowly voted on Tuesday to continue moving forward with legislation to drastically limit access to abortion in the country.

In a secret ballot, initiated by the Socialist Parliamentary Group, MPs voted 183 to 151 against abandoning the proposed changes to the abortion law.

Tabled in late December by the governing People's party, the legislation seeks to enact some of the toughest abortion legislation in Europe. Widely attacked by women's groups as a step backwards, the changes will make abortion illegal except in the case of rape or when there is a risk to the physical and mental health of the mother. Any woman wanting an abortion would require two doctors to verify these circumstances were being met.

The secret vote was an attempt to thwart the bill before it is put to a general vote. The idea, said Carmen Montón of the Spanish Socialist Workers party, came from concerns over the legislation that she and other opposition members heard in parliamentary corridors.

"We want PP's [People's party] parliamentarians – especially the women – to have the freedom to express how they really feel about the issue," she said prior to the vote. "We're trying to take away the excuse that they would be penalized by the barons of the party."

The secret vote was intended to encourage MPs to vote with their constituents rather than party allegiances in mind, she said. "The majority of Spaniards don't want this reform."

The Spanish prime minister, Mariano Rajoy, has consistently defended the changes, arguing they fulfilled an electoral promise. The Catholic Church, which has historical ties to the People's party and remains an influential force in Spain, had championed the changes.

Among Spanish citizens, though, the idea is deeply unpopular. Polls show between 70% and 80% are opposed to rolling back the country's abortion laws.

Organised action against the proposed legislation has been taking place almost every other day across Spain. Petitions have been signed and and letters delivered to parliamentarians. A platform, Wombastic, has been created specifically to share pro-choice drawings.

Demonstrations, backed by worldwide shows of solidarity , culminated in a show of force earlier this month as tens of thousands demonstrated in Madrid, waving signs that demanded "MP and rosaries, out of my ovaries".

This week saw hundreds of women walk into regional government offices demanding that their bodies be entered in commercial registries, normally reserved for cars and airplanes. Activists explained to confused bureaucrats that they wanted official certification that their bodies belong to them.

The government is adamant it will push ahead with the reform. "You have my word that no screams or insults could provoke me to abandon my commitment to comply with the [party] platform to regulate the rights of women and the unborn," Justice Minister Alberto Ruiz-Gallardón said at the People's party convention earlier this month. "We are not talking about moral issues or electoral advantages, but instead the defense of fundamental rights."

But his comments masked internal dissent within the party on the issue. Infighting broke out after several regional leaders spoke against the changes, while dozens of municipalities – including those governed by People party leaders – have also said they will reject the changes.

Isabel Serrano, spokeswoman for Decidir Nos Hace Libres, which opposes the proposed legislation, attributes the result of Tuesday's vote to MPs voting along party lines. She said the result at least showed that the People's party is alone in pushing it forward. "The result was negative, obviously, but the process was positive," she said.

Since the majority of Spaniards are against the changes, she saidPeople's party MPs must now "evaluate whether they want to continue forcefully governing their majority or whether they want to listen to the people".

Until that happens the platform would continue to battle against the proposed changes, she added. "Our objective is to get the People's party to act in favour of women. Our objective is to get them to withdraw this legislation."