A deal setting out terms for a Scottish independence referendum has been signed by Prime Minister David Cameron and First Minister Alex Salmond.
The agreement, struck in Edinburgh, has paved the way for a vote in autumn 2014, with a single Yes/No question on Scotland leaving the UK.
It will also allow 16 and 17-year-olds to take part in the ballot.
The SNP secured a mandate to hold the referendum after its landslide Scottish election win last year.
The UK government, which has responsibility over constitutional issues, will grant limited powers to the Scottish Parliament to hold a legal referendum, under a mechanism called Section 30.
The deal will also commit both governments to working together constructively in the best interests of the people of Scotland, whatever the outcome of the referendum.
Mr Salmond said the agreement would mean a referendum "made in Scotland", while the prime minister said keeping the United Kingdom together was his number one priority.
The deal will provide for:
- A statutory order to be legislated at Westminster, granting Holyrood powers to hold a single-question independence referendum by the end of 2014 and covering other issues like campaign broadcasts.
- A "memorandum of agreement" to be signed by political leaders confirming the details of the referendum will be settled at Holyrood.
- A significant role for the Electoral Commission watchdog in advising on the wording of the question, the running of the referendum and areas including campaign finance.
A possible second question on greater powers has been dropped.
Speaking after the deal was signed at the headquarters of the Scottish government, St Andrew's House, the prime minister told BBC News: "This is the right decision for Scotland.
But it's also right for the United Kingdom that there is going to be one, simple, straightforward question about whether Scotland wants to stay in the United Kingdom or separate itself from the United Kingdom, and that referendum has to be held before the end of 2014.
"I always wanted to show respect to the people of Scotland - they voted for a party that wanted to have a referendum, I've made that referendum possible and made sure that it is decisive, it is legal and it is fair."
Mr Cameron added: "Now we've dealt with the process, we should get on with the real arguments, and I passionately believe Scotland will be better off in the United Kingdom but also, crucially, the United Kingdom will be better off with Scotland."
Mr Salmond said the deal, which he described as the "Edinburgh Agreement", paved the way for the most important political decision Scotland had made in several hundred years.
He added: "It is in that sense a historic day for Scotland and I think a major step forward in Scotland's home rule journey.
"The Edinburgh Agreement means that we will have a referendum in two years' time which will be built and made in the Scottish Parliament on behalf of the Scottish people. I think that is a substantial and important step forward."
Mr Salmond said the respective campaigns could now move on from discussion over process and "get on with the substantive arguments".
He went on: "Do I believe that independence will win this campaign? Yes I do. And I believe we will win it by setting out a positive vision for a better future for our country, both economically and, crucially, also socially.
"It is that vision of a prosperous and compassionate society, a confident society moving forward in Scotland, which will carry the day."
When asked whether he had an exact date in mind for the referendum, and whether he would share it, Mr Salmond replied: "Yes, and no".
He said the Scottish government had still to publish the results of its consultation on the referendum, which would happen in the "near future".
The deal was negotiated between Scottish Secretary Michael Moore, a Liberal Democrat MP, and Scotland's deputy first minister, Nicola Sturgeon.
Scottish Labour leader Johann Lamont said she was pleased a deal had been reached, adding: "Alex Salmond has the right to ask the question and now people have right to answer it.
"But we cannot allow this debate to distract from some of the real problems being faced by families in Scotland, things the SNP could act on now."
"Alex Salmond offers people only one solution to Scotland's problems - a referendum on independence - but his timetable makes us wait another two years to have our say."