Ruth Davidson has resigned as leader of the Scottish Conservatives "with a heavy heart".

She is standing down after eight years at the helm of the party, in which she turned the Conservatives into the second largest group at Holyrood and boosted her party's number of MPs to 13.

Davidson announced in Edinburgh that she had written to the Scottish Tory chairman to formally tender her resignation.

She said the decision, which was revealed by the media on Wednesday - the same day Prime Minister Boris Johnson announced the suspension of Parliament - was both a "professional and personal choice".

Davidson alluded to her "conflict" over Brexit, having backed Remain in the 2016 vote, but she said she would stay committed to her party and the PM's attempts to get a new Brexit deal.

Johnson paid tribute to the 40-year-old, thanking her for her "wonderful service".

Davidson said: "It has been the privilege of my life to serve as the leader of the Scottish Conservative and Unionist party.

"The almost eight years I've spent at the helm have coincided with one of the most remarkable and important periods of recent Scottish political history.

"I am proud of the teams we have built in Holyrood, Westminster and in council chambers across the country and proud of our electoral successes in recent years.

"All that pales in significance compared to vital role our party undertook in the Scottish Independence referendum of 2014.

"I will always consider that the most important contribution of my working life and my commitment to keeping the United Kingdom together remains undimmed."

Davidson continued: "None of the achievements mentioned above would have been possible without your support, guidance and friendship - along with the hard work and professionalism of the Scottish Conservative team at central office. For all of this, thank you."

The Edinburgh Central MSP went on: "Inevitably, much has changed over the years of my leadership - both personally and in the wider political context.

"While I have not hidden the conflict I have felt over Brexit, I have attempted to chart a course for our party which recognises and respects the referendum result, while seeking to maximise opportunities and mitigate risks for key Scottish businesses and sectors.

"The biggest change, of course, has been starting a family. I cannot thank you, Jackson Carlaw and the wider party enough for the generosity and support you have all shown to Jen and me following the birth of baby Finn.

"It made my return to work in April as smooth as I could have hoped and I believe the flexibility shown by colleagues has allowed me these last months to continue operating successfully in my role as leader.

"However, as I look to the future, I see the Scottish Election due in 2021 and a credible threat from our opponents to force a general election before then.

"Having led our party through seven national elections and two referenda, I know the efforts, hours and travel required to fight such campaigns successfully.

"I have to be honest that where the idea of getting on the road to fight two elections in 20 months would once have fired me up, the threat of spending hundreds of hours away from my home and family now fills me with dread. That is no way to lead."

She said she had tried to be a "good leader" but feared she had been a "poor daughter, sister, partner and friend".

Davidson said: "The party and my work has always come first, often at the expense of commitments to loved ones. The arrival of my son means I now make a different choice.

"While I offer you my resignation as party leader, I intend to continue in my role as the MSP for Edinburgh Central until 2021.

"I will always be thankful for the opportunity to serve and to the amazing teams I have worked alongside.

"Be assured I will continue to support the party, the Prime Minister and Scotland's place in the United Kingdom from the backbenches and beyond."

Davidson clashed with Boris Johnson during the 2016 EU referendum, and her resignation came just a day after the Prime Minister announced he will suspend Parliament for five weeks in the run-up to Brexit deadline of October 31.

However, she stressed it was "both professional and personal" changes that had led to her decision to quit.

Answering questions from the media after her statement, Davidson said: "I stand absolutely full-square behind the Prime Minister's attempts to bring back a deal that can pass in the House of Commons."

She added: "I think we had three golden opportunities to support a deal, I think that the people right now who are saying they would do anything to avoid no-deal had a goal gaping in front of them three times and they hit the ball over the bar."

Johnson said Davidson had been "instrumental" in rebuilding the party over the past eight years.

He said: "She should take immeasurable pride in the pivotal role she played during the Scottish independence referendum campaign, where her passionate support for our Union was crucial to the result.

"I will miss the incredible leadership she has given to our party in Scotland, but I am delighted that she will continue to use her enthusiasm, passion and dedication to make the case for Scotland's place in the United Kingdom from the backbenches and beyond."

Nicola Sturgeon sent Davidson, her longtime political rival, her best wishes.

The First Minister tweeted: "I wish Ruth well for the future.

"I know well the toll political leadership can take on family life, and no one will grudge her more time with her young son.

"There will be opportunity later to discuss the politics of her decision - but for now, I'll simply send my best wishes."

Former prime minister Theresa May said she was "sorry" to see Ms Davidson stepping down as leader, tweeting: "Thank you for all you've done for our party and our Union over the last eight years, and enjoy your well-deserved family time with Jen and Finn."

Meanwhile Chancellor Sajid Javid, who Davidson backed first in the Tory leadership contest this summer, also paid tribute to her.

"Without her efforts we would now be two years into a disastrous Corbyn-Sturgeon pact," he said.

"Happy that she is now able to get the family time she deserves, but also hope we will see her back in the fray before too long!"

New Scottish Secretary Alister Jack thanked Davidson for her "inspirational and transformational" work as Scottish party leader since 2011.

Davidson had lobbied the PM to keep David Mundell, the previous Scottish secretary, in the job, but he was replaced by Jack in Johnson's bloody July reshuffle .

Jack said: "Ruth Davidson has been an outstanding leader of the Scottish Conservatives for nearly eight years and I want to put on record my thanks for everything she has achieved.

"Her leadership has been inspirational and transformational.

"She has inspired a new generation of Scottish Conservative politicians, activists and supporters - and in turn that has transformed our party's fortunes.

"In short, she has made the Scottish Conservatives the only credible challenger to the SNP in Scotland."

The former Scottish Tory leader only returned to work in May after a long stint away on maternity leave to give birth to her first child.

Davidson and partner Jen Wilson welcomed a son, Finn, in October 2018 after she underwent IVF treatment.

She is widely credited with turning her party's fortunes around electorally, taking over from Labour as the official Holyrood opposition after doubling Scottish Tory seats to 31 in the 2016 Holyrood election.

The Scottish Conservatives then gained 12 seats to go up their tally of MPs from one to 13 in the snap general election two years ago.