The House of Lords has voted to support the government's plans for people of the same sex to be allowed to marry in England and Wales.
For the Lords to vote this way is a big step towards the law being changed. It follows MPs voting to back the plans last month.
A debate that lasted two full days ended in a vote where two-thirds of the Lords backed the proposals.
Strong feelings were expressed on both sides of the argument.
The Archbishop of Canterbury argued against the change, saying it: "weakens what exists and replaces it with a less good option that is neither equal nor effective".
But Baroness Royall, Labour's leader in the Lords, said: "I firmly believe that our society will be strengthened when more couples are able to choose to make a lifetime commitment to each other and when all members of our communities are able to celebrate their identity and relationships within the institution of marriage."
What would change?
At the moment, couples of the same sex in England and Wales are not allowed to marry - they can only have what's called a civil partnership.
Read more: Same-sex marriage plans set out
A civil partnership offers similar legal rights, but isn't exactly the same as marriage.
Religious groups - many of whom disagree with the change in the law - would not have to conduct same-sex weddings under the plans.
Scotland has also announced plans to legalise same-sex marriage - but there are no such plans in Northern Ireland.