Image copyright Getty Images Image caption Prime Minister David Cameron meets First Minister Alex Salmond at St Andrew's House in Edinburgh

Image copyright AP Image caption The political leaders shake hands ahead of signing the referendum agreement

Image copyright Getty Images Image caption A photocall takes place with David Cameron, Michael Moore, Alex Salmond and Nicola Sturgeon

Image copyright Getty Images Image caption The agreement is signed by the leaders of the Scottish and UK governments

Image copyright Reuters Image caption Negotiators Michael Moore and Nicola Sturgeon also place their signatures on the document

Image copyright Reuters Image caption In a news conference following the agreement, Alex Salmond says it has been a historic day for Scotland

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.

Media playback is unsupported on your device Media caption David Cameron says the agreement includes "one simple, straightforward question"

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.

Real arguments

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.

The editors - Analysis Nick Robinson, BBC political editor - "They shake hands. They smile for the cameras. They hail an agreement which allows the people of Scotland to determine their own future. However, both men will know that there can only be one winner......" Read more

- Read more Brian Taylor, BBC Scotland political editor - "As he briefed the media about today's agreement, Alex Salmond confided that he had been told by his advisers: do not look triumphalist. Plainly, they know their man....." Read more

- Read more Douglas Fraser, BBC Scotland business editor - "The price of a third-generation iPad. That seems to be enough to swing the independence referendum. If independence made them £500 better off, 65% of Scots told one poll they'd vote for it. But if it made them as much worse off, only 21%......" Read more

"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".

Media playback is unsupported on your device Media caption First Minister Alex Salmond says the agreement on a referendum on Scottish independence is 'a historic day for Scotland'

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."