Kezia Dugdale has tonight resigned as Scottish Labour leader. Below is the text of the letter she sent to the party chair.

Dear Linda,

As Chair of the party, I am writing to you today to resign as Leader of the Scottish Labour Party.

It has been an honour and a privilege to have served this party in a leadership position for the last two and a half years, covering four national elections and one referendum.

I have worked with many great people, not least the staff in our HQ led by Brian Roy and those in the Scottish Parliament, whose boundless energy, expertise and good humour has guided our party through some dark hours and difficult times.

I’d like to thank my shadow cabinet for their efforts, and in particular Iain Gray for his unflinching love and support and James Kelly for the thankless but crucial job he does so well as our Business Manager.

Earlier this year I lost a dear friend who taught me a lot about how to live. His terminal illness forced him to identify what he really wanted from life, how to make the most of it and how to make a difference. He taught me how precious and short life was and never to waste a moment.

Being leader has always been a difficult but fulfilling challenge. One that until now I have enjoyed, driven by a clear guiding purpose and goals, many of which I have achieved.

I am proud of the fact that I’ve demonstrated how the parliament’s powers can be used to stop austerity with progressive taxes and the creation of new benefits. Proud to have advanced the call for federalism across the UK. Proud to have delivered real autonomy for the Scottish Labour Party and a guaranteed voice for Scotland and Wales on the NEC.

Educational inequality is the number one issue in Scottish politics after the constitution because Scottish Labour under my leadership put it there.

I am proud to have delivered 50/50 slates of amazing and diverse candidates in both the Scottish and U.K. Elections and equally proud to have invested in the next generation of labour activists and parliamentarians with leadership programmes. These have already furnished us with two of our magnificent seven MPs. With that re-established Scottish Labour group at Westminster, and a talented and effective group in Holyrood, Scottish Labour has a bright future.

A marker of success for me was to leave as leader with the party in better shape than I found it and I have done that.

Emerging from the challenging times following the 2014 referendum, and the 2015 UK election, we now have a solid platform on which to build towards success, and government.

I have given the task of achieving this all that I have. But with nearly four years now until the next Scottish Parliament elections, I am convinced that the party needs a new leader with fresh energy, drive and a new mandate to take the party into that contest.

I will continue as a Labour MSP for the Lothians and am already looking forward to spending more time with constituents and on constituency issues.

Too often our leaders leave in a crisis, with scores to settle. I love this party too much for that to be my way. There will be no press conference and no off the record briefing in my name. I choose to stand down because I believe it is best for me and best for Scottish Labour, at a time when we can be positive and optimistic about our future.

I remain in awe of all those party activists who devote their time to this movement without pay or reward. I thank them for their belief in me.

Yours in solidarity,

Kez Dugdale