Heterosexual couples will be able to tie the knot in civil partnerships under new Scottish government plans.
It means mixed-sex partners will have the same choices of marriage or civil partnerships as same-sex couples.
The decision follows a ruling in the Supreme Court last year, which found that the existing UK law went against the European Convention on Human Rights on equality grounds.
A bill will be introduced to the Scottish Parliament in the autumn.
A consultation on the issue was launched last September to consider either barring further civil partnerships or opening them up to opposite-sex couples.
After considering all 481 responses, ministers decided to make the partnerships - which offer the same legal and financial protection as marriage - available to everyone.
Shirley-Anne Somerville, the cabinet secretary for social security and older people, said it was a "ground-breaking change for Scotland".
"We will be providing people with the option to enter into a legally recognised relationship which reflects their personal views," she added.
"We wanted to ensure all voices were heard in regard to the future of civil partnership in Scotland and we have listened very carefully to the views of respondents to the consultation.
"This is about ensuring we are compatible with ECHR law and creating an inclusive, fairer Scotland which promotes equality of choice and human rights for everyone."
Following the Supreme Court ruling in favour of campaigners Rebecca Steinfield and Charles Keidan last June, the UK government also plans to extend civil partnerships to heterosexual couples.
The Scottish government's announcement has been welcomed by campaign groups including the Humanist Society of Scotland.
Its chief executive, Fraser Sutherland, said: "It is disappointing that it took a couple to lodge a legal challenge at the Supreme Court to force the issue.
"Now we will be able to offer all couples the choice of a legal marriage or civil partnership, and we look forward to carrying out the first of these opposite-sex civil partnerships in the months to come."
Civil partnerships became available to same-sex couples in 2005.
Since a law change allowed same-sex marriage five years ago, the number of partnerships in Scotland has dropped from 446 in 2014 to 64 the following year.