Members of the Scottish Parliament passed the measure by a 98-15 vote margin more than three hours after they began debating it.
“Equal marriage is an idea whose time has come,” MSP Jackie Baillie of Dumbarton said.
Gay MSPs Marco Biagi of Edinburgh and Ruth Davidson of Glasgow are among those who also spoke in support of the bill.
“I believe in marriage,” Davidson said. “I believe it is a good thing and [something] to be celebrated and I want everybody in Scotland to know it is open to them.”
MSP Elaine Smith said the measure does not go far enough to protect freedom of speech and religion.
“This bill may well have detrimental consequences for many people,” she said.
Gays and lesbians can legally marry in 15 countries that include Iceland, France and the Netherlands.
Same-sex couples in England and Wales will be able to tie the knot next year. The Irish government earlier this month announced a referendum on whether to extend marriage rights to same-sex couples in the country will take place in 2015.
Gays and lesbians have been able to enter into civil partnerships in Scotland and across the U.K. since 2005.
A Scottish parliamentary committee will consider the same-sex marriage bill before it returns to the full legislative body. A final vote on the measure is expected to take place early next year.
“This legislation does not in any way redefine our own marriage,” Scottish Health Secretary Alex Neil said. “What it does do is extend the eligibility of marriage.”