The Church of England has been plunged into its gravest crisis in decades after legislation that would have allowed female clergy to become bishops and swept away centuries of entrenched sexism was rejected by just six votes.

In dramatic scenes at Church House in Westminster, a long-awaited measure that was the result of 12 torturous years of debate and more than three decades of campaigning was defeated by lay-members, prompting one bishop to warn that the established church risked becoming “a national embarrassment”.

The legislation had needed a two-thirds majority in each house of synod to pass, but, despite comfortably managing that in both the houses of bishops and clergy, it was dealt a fatal blow in the laity where lay-members voted 132 votes in favour and 74 against.

The result - a huge disappointment for campaigners who warned that the church’s image in the eyes of parliament and the public had been severely damaged- was also a bitter blow to Rowan Williams, the outgoing Archbishop of Canterbury whose time at Lambeth has been dominated by the issue and who had campaigned personally for a ‘yes’ vote.