The vote was passed by 309 to 182 in a vote by the General Assembly in Edinburgh.
It is due to vote on Thursday on a separate measure which would allow the ordination of clergy in same-sex marriages.
The move has been pushed through without a major revolt from traditionalists - the Herald newspaper reported today that only around one in 50 ministers had left the church as a result.
The moderator or chairman of the General Assembly, John Chalmers, will urge it to recognise "the power of harmony" in a speech later.
South of the border, the Church of England bans gay clergy from marrying their partners but some bishops have started to question the policy.
It does allow clergy to enter civil partnerships as long as they remain celibate.