Same-sex couples will be able to get married in Scotland from 31 December 2014.
Couples who are already in a civil partnership will be able to convert that into a marriage from 16 December onwards.
Gay couples in England and Wales have been able to tie the knot since 29 March this year.
Making the announcement Health Secretary Alex Neil called the move “an important signal that our nation is absolutely committed to the same rights for all our citizens”.
He went on to say: “It is wonderful that same-sex couples can now begin to make plans to have their marriage just as any other couple can.
“This historic legislation had overwhelming support across the Scottish Parliament, demonstrating to the world how importantly Scotland views equality.
“That support means that, from 31 December, same-sex couples who want to show their love and commitment to each other could get married in front of family and friends at a ceremony they choose together.”
Tom French, policy and public affairs coordinator for the Equality Network, welcomed the news and said: “We are very pleased that after years of campaigning for equal marriage it is now just weeks away from becoming a reality.
“Today’s milestone announcement means that same-sex couples across Scotland will be able to set a date and start planning their weddings. With the first ceremonies set to take place on Hogmanay, Scotland can be proud that we will bring in the New Year as a fairer and more equal country.”