Ever since I first stepped through the door behind me as prime minister, I have striven to make the United Kingdom a country that works not just for a privileged few, but for everyone.

And to honour the result of the EU referendum.

Back in 2016, we gave the British people a choice. Against all predictions, the British people voted to leave the European Union. I feel as certain today as I did three years ago that in a democracy, if you give people a choice you have a duty to implement what they decide.

I have done my best to do that.

I negotiated the terms of our exit and a new relationship with our closest neighbours that protects jobs, our security and our union. I have done everything I can to convince MPs to back that deal.

Sadly, I have not been able to do so.

I tried three times. I believe it was right to persevere, even when the odds against success seemed high. But it is now clear to me that it is in the best interests of the country for a new prime minister to lead that effort.

So I am today announcing that I will resign as leader of the Conservative and Unionist party on Friday 7 June so that a successor can be chosen.

I have agreed with the party chairman and with the chairman of the 1922 Committee that the process for electing a new leader should begin in the following week.

I have kept Her Majesty the Queen fully informed of my intentions, and I will continue to serve as her prime minister until the process has concluded.

It is, and will always remain, a matter of deep regret to me that I have not been able to deliver Brexit. It will be for my successor to seek a way forward that honours the result of the referendum. To succeed, he or she will have to find consensus in parliament where I have not. Such a consensus can only be reached if those on all sides of the debate are willing to compromise.

For many years the great humanitarian Sir Nicholas Winton – who saved the lives of hundreds of children by arranging their evacuation from Nazi-occupied Czechoslovakia through the Kindertransport – was my constituent in Maidenhead.

At another time of political controversy, a few years before his death, he took me to one side at a local event and gave me a piece of advice. He said: “Never forget that compromise is not a dirty word. Life depends on compromise.”

He was right.

As we strive to find the compromises we need in our politics – whether to deliver Brexit, or to restore devolved government in Northern Ireland – we must remember what brought us here. Because the referendum was not just a call to leave the EU but for profound change in our country.

A call to make the United Kingdom a country that truly works for everyone. I am proud of the progress we have made over the last three years. We have completed the work that David Cameron and George Osborne started: the deficit is almost eliminated, our national debt is falling and we are bringing an end to austerity.

My focus has been on ensuring that the good jobs of the future will be created in communities across the whole country, not just in London and the south-east, through our modern industrial strategy.

We have helped more people than ever enjoy the security of a job.

Play Video 0:42 Theresa May's voice cracks at end of resignation speech – video

We are building more homes and helping first-time buyers onto the housing ladder – so young people can enjoy the opportunities their parents did. And we are protecting the environment, eliminating plastic waste, tackling climate change and improving air quality.

This is what a decent, moderate and patriotic Conservative government, on the common ground of British politics, can achieve – even as we tackle the biggest peacetime challenge any government has faced.

I know that the Conservative party can renew itself in the years ahead. That we can deliver Brexit and serve the British people with policies inspired by our values – security, freedom, opportunity. Those values have guided me throughout my career.

But the unique privilege of this office is to use this platform to give a voice to the voiceless, to fight the burning injustices that still scar our society. That is why I put proper funding for mental health at the heart of our NHS long-term plan.

It is why I am ending the postcode lottery for survivors of domestic abuse. It is why the race disparity audit and gender pay reporting are shining a light on inequality, so it has nowhere to hide.

And that is why I set up the independent public inquiry into the tragedy at Grenfell Tower – to search for the truth, so nothing like it can ever happen again, and so the people who lost their lives that night are never forgotten.

Because this country is a union. Not just a family of four nations. But a union of people – all of us. Whatever our background, the colour of our skin, or who we love. We stand together. And together we have a great future.

Our politics may be under strain, but there is so much that is good about this country. So much to be proud of. So much to be optimistic about.

I will shortly leave the job that it has been the honour of my life to hold – the second female prime minister but certainly not the last. I do so with no ill-will, but with enormous and enduring gratitude to have had the opportunity to serve the country I love.