The Polish parliament has rejected a controversial bill proposing a near total ban on abortions that sparked mass protests.

Poland's conservative parliamentary majority overwhelmingly rejected the bill, which would have banned abortion even in cases in which pregnancy was the result of rape or incest.

The governing Law and Justice (PiS) party and liberal MPs joined forces to reject the bill by a vote of 352-58, with 18 abstentions, AFP reported.

The bill, proposed by Catholic group Ordo Iuris, would have tightened Poland's already restrictive abortion laws, allowing for termination only in cases in which the mother's life was directly threatened. Those guilty of having illegal abortions faced fines and up to five years in jail.

More than 500,000 people signed a petition supporting the bill, which gained the backing of enough PiS MPs to be sent for further debate at committee stage.

Opponents of the bill held mass protests across Poland, with thousands of women dressed in black taking to the streets of Warsaw on Monday (3 October), boycotting work and classes.

PiS MPs withdrew their support at the committee where the bill was debated Wednesday, and the bill was later overturned in parliament.

Legal abortions in Poland, which has a population of 38 million, are limited to around 700 to 1,800 per year. However, the Federation for Women and Family Planning estimates that each year about 150,000 abortions are performed either illegally or abroad.