MSPs voted by 69 to 59 this week in favour of seeking permission for an independence referendum to take place between autumn 2018 and spring 2019.

The letter said: "In these very changed circumstances, the people of Scotland must have the right to choose our own future - in short, to exercise our right of self determination."

Ms Sturgeon also said leaving the EU and the single market would have "enormous implications" for schools, hospitals, jobs and investment in Scotland.

Read the full text of the letter:

Dear Theresa

When we met in Glasgow on Monday, I wished you well for the negotiations that lie ahead now that you have formally invoked Article 50 of the Lisbon Treaty. I want to reiterate those good wishes now.

I very much hope that you succeed in realising your ambitions for the terms of the UK's future relationship with the EU. A good deal for the UK is clearly in Scotland's interests whatever constitutional future we choose.

It is for that reason that I intend that the Scottish Government will play a full and constructive role in securing such an outcome.

I expressed my frustration on Monday that the process leading up to the invoking of Article 50 had failed to involve the devolved administrations in any meaningful way - a view that I know is shared by the First Minister of Wales.

Far from securing a UK wide approach ahead of invoking Article 50 - as you committed to do last July - the voices of the devolved administrations were largely ignored and all attempts at compromise rejected, in most cases with no prior consultation.

As we move forward into a new phase, we need to agree a more direct role and influence for the devolved administrations, reflecting the key interests that are at stake for all of us.

However, whatever outcome is secured, it seems inevitable that it will remove the UK, not just from the EU, but also from the single market. As you are aware, that is not an outcome that the people of Scotland voted for. It is also an outcome that will have significant implications for our economy, society and place in the world.

In these very changed circumstances, the people of Scotland must have the right to choose our own future - in short, to exercise our right of self determination.

Indeed I noted the importance you attached to the principle of self determination in your letter to President Tusk.

As you are aware, the Scottish Parliament has now determined by a clear majority that there should be an independence referendum. The purpose of such a referendum is to give people in Scotland the choice of following the UK out of the EU and single market on the terms you negotiate, or becoming an independent country, able to chart our own course and build a genuine partnership of equals with the other nations of the UK. A copy of the motion passed by Parliament on 28 March 2017 is attached.

The decision of the Scottish Parliament has been made in line with the tradition of popular sovereignty in Scotland - that the people of Scotland should be able to determine the form of government most suited to their needs - and with the clear commitment in the manifesto on which my government was re-elected last May.

I am therefore writing to begin early discussions between our governments to agree an Order under section 30 of the Scotland Act 1998 that would enable a referendum to be legislated for by the Scottish Parliament.

I have, of course, noted and carefully considered your public position. However, it seems that we are in agreement on the essential matters.

For example we agree that now is not the time for a referendum.

You confirmed to me on Monday, and repeated in your letter invoking Article 50, that you intend the terms of both the UK's exit from the EU and of a future trade deal to be agreed before March 2019 and in time for ratification by other member states - in other words, between the autumn of next year and the spring of 2019. As you are aware, this is the timescale endorsed by the Scottish Parliament for a referendum.

As I have said previously, if the timetable you have set out changes, we will require to consider the implications for the timing of a referendum. However, it seems reasonable at this stage to work on the basis of your stated timetable.

We are also in agreement that - unlike the EU referendum - the choice must be an informed one. That means that both the terms of Brexit and the implications and opportunities of independence must be clear in advance of the referendum.

It is also worth noting that the clear precedent of the 2012 Edinburgh Agreement should make reaching agreement on this occasion a relatively straightforward process - addressing any concern you may have that discussions would be time consuming for your government when they are also preparing for EU negotiations.

In light of the above, there appears to be no rational reason for you to stand in the way of the will of the Scottish Parliament and I hope you will not do so.

However, in anticipation of your refusal to enter into discussions at this stage, it is important for me to be clear about my position.

It is my firm view that the mandate of the Scottish Parliament must be respected and progressed. The question is not if, but how.

I hope that will be by constructive discussion between our governments. However, if that is not yet possible, I will set out to the Scottish Parliament the steps I intend to take to ensure that progress is made towards a referendum.

Again, I wish you well for all that lies ahead and stand ready to discuss both a section 30 order and the Scottish Government's role in securing the best outcome for all parts of the UK.

I am copying this letter to the Presiding Officer of the Scottish Parliament and to Bruce Crawford, Convener of the Parliament’s Finance and Constitution Committee.

– Nicola Sturgeon

The First Minister also posted a video message on Twitter on Friday morning, explaining her reasons for writing the letter.

Sorry, this content isn't available on your device.

"The next two years are hugely important for Scotland because they will determine the kind of country we'll become," she says.

"That's why I have today written to the UK Government to ensure that we can make that choice when the time is right to accept Brexit or instead become an independent country."

I don't take for granted how people would vote when that choice comes but I hope we can all agree that the future of our country is our choice.

The Prime Minister has indicated that she intends to ignore the will of the Scottish Parliament and seek to prevent people in Scotland having that choice.

If the Westminster government continues to hold that line, it will go against the very foundations of devolution.

So, I hope the Prime Minister changes her mind and acknowledges that the people of Scotland are entitled to a choice at a time and in a way that is right for Scotland.

However, if she doesn't, as I expect she won't, at least not yet, I will come back to the Scottish Parliament in a few weeks' time with an update on how we're going to move forward to ensure that the people of Scotland are able to choose our future when we have the information we need both about Brexit and about independence, and while there is still time to take a different path.

– Nicola Sturgeon's video message

Ms Sturgeon said in an interview on Friday morning that she wants to make "make sure the will of the Scottish Parliament is respected".

"If the Prime Minister chooses not to do that I will set out to Parliament over the next few weeks what I intend to do to make sure that the will of Parliament is respected and we make progress towards giving people choice."

The UK Government has said it will decline the request, with Mrs May repeatedly stating "now is not the time" for another vote on the issue.

However, Ms Sturgeon has said her mandate for another vote is "beyond question" and is pressing ahead with a formal approach for a Section 30 order - the mechanism for the powers to hold a referendum.

The Prime Minister has been clear that now is not the time for a second independence referendum, and we will not be entering into negotiations on the Scottish Government's proposal.

At this point, all our focus should be on our negotiations with the European Union, making sure we get the right deal for the whole of the UK.

It would be unfair to the people of Scotland to ask them to make a crucial decision without the necessary information about our future relationship with Europe, or what an independent Scotland would look like.

We have been joined together as one country for more than 300 years.

We've worked together, we've prospered together, we've fought wars together, and we have a bright future. At this crucial time we should be working together, not pulling apart.

– UK Government spokeswoman

Scottish Labour leader Kezia Dugdale said: "People across Scotland will be dismayed that Nicola Sturgeon is more focused on re-running the arguments of the past than doing her job of running our public services.

"Scotland doesn't need or want a second independence referendum.There is absolutely no evidence that another divisive referendum is the will of the people of Scotland.
"We need the SNP Government to get on with the job of governing."