Ruth Davidson has quit as leader of the Scottish Conservatives after eight years in the job.
In a statement she said it had been the “privilege of my life” to have led the party.
But she added that “much had changed” both politically and personally, which had led her to tender her resignation.
Ms Davidson had a baby last year, and has been a vocal critic of Prime Minister Boris Johnson – particularly over his approach to Brexit.
She also said her personal priorities had changed, and the prospect of spending hundreds of hours away from her son and partner during a possible election campaign now filled her with “dread”.
The 40-year-old, who will continue as the MSP for Edinburgh Central, tweeted her resignation statement shortly before addressing the media at an event in Edinburgh on Thursday morning.
Conservative sources insisted that her decision to leave the post had been building for several months, and was not a direct result of Mr Johnson announcing that he would suspend parliament for several weeks ahead of the Brexit deadline on 31 October.
Ms Davidson has been widely credited with turning around the fortunes of the Tories in Scotland, but backed opponents of Mr Johnson in the Conservative leadership race and has said she could not support a no-deal Brexit.
She said she had tendered her resignation with a “heavy heart”, and pledged to continue to support the party and the prime minister “from the backbenches and beyond”.
Mr Johnson paid tribute to Ms Davidson’s “incredible leadership”, which he said had been “instrumental in the revival of our electoral fortunes in Scotland”.
The prime minister added: “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”.
Her deputy, Jackson Carlaw, will become acting leader – a role he filled during Ms Davidson’s maternity leave – until a permanent successor is chosen.
Ms Davidson backed Remain ahead of the EU referendum and famously clashed with Mr Johnson in a BBC TV debate at Wembley ahead of the vote – when she accused the Leave side of telling “untruths”.
She said she had never sought to hide the “conflict” she felt over Brexit, but had 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”.
However, she said the biggest change she had faced was starting a family last year with her partner Jen Wilson.
Ms Davidson added: “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 also said she feared her focus on being a “good leader” in recent years had made her a “poor daughter, sister, partner and friend”, and that the arrival of her son Finn last October “means I now make a different choice”.
When she returned to the Scottish Parliament from maternity leave in May, she told BBC Scotland that it would be “tough to tear myself away from the wee man” but that “having a child and coming back to work is a part that lots of women play”.
Under her leadership, the Scottish Conservatives more than doubled their number of seats at Holyrood in the 2016 election – making the party the second biggest behind the SNP. The following year it increased its MPs from one to 13 in the general election.
That relative success had seen her tipped as a future UK Tory leader and prime minister, but she insisted she had no interest in the job – and that she was focused only on replacing Nicola Sturgeon as first minister of Scotland at the next Holyrood election in 2021.
She also said in her resignation statement that her party’s electoral successes had paled in significance compared to the role it had played in the campaign to keep Scotland in the UK during the independence referendum campaign.
She added: “It was – without doubt – the most important contribution of my working life and, I believe, will remain so.”