A male prostitute turned gay priest has entered the Canadian Parliament after a shock by-election victory.

Raymond Gravel, who was once criticised by the Pope for his pro-gay views, won the election in Repentigny, representing the Bloc Quebecois Party, which campaigns for sovereignty of the Quebec province.

He beat Conservative candidate Stephane Bourgon, in what will be seen as a blow to Prime Minister Stephen Harper’s government.

Mr Gravel has been criticised by the Pope before over his support of gay priests, same sex marriage and abortion.

He became a priest after being beaten up as a rent boy.

Earlier this year, Mr Gravel joined a group of Canadian priests in a public criticism of the Vatican’s ban on gay clergy.

In the largest internal opposition to the Catholic stance on homosexuality, 19 priests condemned the church’s view on being gay and requested a new dialogue on the issue.

They wrote a letter published in Montreal newspaper La Presse opposing the Catholic view that being gay is a “disorder”

One of the priests, Raymond Gravel, told The Gazette in Montreal, “There is no reason for the ban on homosexual men from entering the priesthood.” He said the Vatican’s invocation of “natural law” to support its antigay position was not legitimate, because the Church has been wrong on issues related to “the mysteries of life” before, as it is now.

He added that the Church was contributing to homophobia with its views, and that he and his fellow signatories could no longer stay silent about it.