The Church of England has finally agreed that women may become bishops next year, breaking with nearly 2,000 years of tradition and ending 20 years of bitter compromises since women were allowed to become priests in 1994.

Applause in the public gallery greeted the overwhelming vote in favour of the measure. Only 45 lay members of the synod voted against it and 152 in favour. The majorities among bishops and clergy were even greater.

The synod had been threatened with parliamentary action if the measure had failed, and the Archbishop of Canterbury, Justin Welby, had prepared contingency plans to dissolve it and call fresh elections if the vote had gone the wrong way.

But the crisis was averted by a change of mind, and vote, among lay members. A previous attempt in 2012 failed when 74 lay members voted against, preventing the required two-thirds majority among the laity.

The vote means the first woman might become a suffragan (assistant) bishop early next year and her appointment could be announced before the end of 2014. Suffragan vacancies are expected to be filled soon in St Albans.

But because the legislative process will not be complete before the synod next meets in November it will not be legal to place women on the shortlist for consideration as a diocesan (senior) bishop before then. This means that the earliest a woman might take her place in the House of Bishops is next summer.

The first diocesan job to become open to women is Gloucester, whose next bishop will be chosen at a meeting in early January, followed by Oxford and then Newcastle. But none of those women will automatically gain seats in the House of Lords and none of the church's really big jobs are scheduled to fall vacant in the immediate future.

The vote may have been tipped by a closing speech of astonishing force and passion by a blind evangelical Christian who rose to become managing director of Lloyds bank after he had lost his sight.

Speaking to the key evangelical community opposed to the measure, John Spence told them: "Your faith is my faith, is all of our faith, and every one of us has a vital role to ensure that the searing vision of the risen Christ is taken out into this country, trust not misplaced. You, like me, will come to see … I am confident that we can walk hand in hand, and return the risen Christ to his rightful place at the centre of this country, its conscience and its culture."

Earlier Welby had urged the synod to vote in favour, saying that the move would show the world how Christians could practice "good disagreement".

Twenty-seven of the earlier opponents changed their minds, among them Tom Sutcliffe, who said the measure would now bring "episcopal femininity" that would enrich the church.

The conservative evangelical block, which holds that men must never be taught by women, was not entirely pacified by the promise that a male bishop would be appointed who shared their view that the "headship" of the church must be male. Their lay members voted consistently against, as they had done two years ago.

Although the influential conservative evangelical Philip Giddings announced early in the debate that he would vote in favour of the new legislation – there had been moves to unseat him from his post as chairman of the House of Laity after he voted against in 2012 – a number of speakers from his faction, many of them women, announced their continuing opposition and complained that they were marginalised for their convictions.

But the Anglo-Catholics who had opposed female bishops on grounds of tradition yielded in larger numbers.