The move does not change the Church’s teaching that marriage is only between a man and a woman.
The Church of England has backed proposals to allow prayers of blessing for same sex couples.
Its position on gay marriage will not change and same-sex couples will still be unable to marry in church.
The plans, set out by bishops last month, have been criticised from those who think they go too far and those who think they don’t go far enough.
But the motion was passed in all three of synod’s ‘houses’.
The Archbishop of York, the Most Revd Stephen Cottrell, said priests would have the option to bless gay couples, but could choose not to.
“No-one has to offer these services and no one will be disadvantaged if they don’t,” he told the Synod.
The Archbishop of Canterbury, the Most Rev’d Justin Welby, said there was “painful” disagreement within the church but he supported the proposals.
“I am supporting these resources, not I think because I’m controlled by culture, but because of scripture, tradition and reason evidenced in the vast work done over the last six years so ably by so many. I may be wrong. Of course I may.
“But I cannot duck the issue any more than anyone else here.”
In more than eight hours of debate there were 18 votes on attempted amendments, both from conservatives and liberals.
An amendment to force a vote on changing the Church’s teaching and allowing gay couples to marry in Church was rejected.
The only amendment that passed was from conservatives, reinforcing that the new prayers of blessing “should not be contrary to or indicative of a departure from the doctrine of the Church of England” which does not allow same-sex marriage.
Immediately before the vote a minute of silence was observed followed by a prayer said by the Archbishop of Canterbury.
Approval of the motion allows same-sex couples to go to Anglican churches after a legal marriage ceremony for services including prayers of dedication, thanksgiving and God’s blessing.
The motion had been brought by the Bishop of London, Dame Sarah Mullally, and was the result of six years of work on questions of identity, sexuality, relationships and marriage known as Living In Love And Faith.
BBC religion editor Aleem Maqbool said: “It may sound contradictory to vote to bless same-sex marriages, but still consider them as unions that defy Church of England doctrine but that after five years of consultation is the formula that’s been settled on”.
He said Church leaders were celebrating the move as “a watershed moment and a move forward towards acceptance of LGBTQ unions, but in a way that holds the institution together”.
This is not the type of marriage equality that, for example, the Episcopal Church in Scotland long approved – for now, gay couples will still be not be able to have a Church of England marriage.
The final motion was passed across the synod’s three ‘houses’. The House of Bishops voted 36 in favour, four against with two abstentions. The House of Clergy voted 111 in favour, 85 against and 3 abstentions. The House of Laity voted 103 in favour, 92 against, and 5 abstentions.
The bishops will now finalise the wording of the new prayers and also issue new guidance on whether gay clergy must remain celibate before the synod meets again in July.