Tim Farron has stepped down as leader of the Liberal Democrats, less than a week after the general election.
In a statement, he said he was “torn between living as a faithful Christian and serving as a political leader”.
He said he should have dealt “more wisely” with questions relating to his faith during the election campaign, including his views on gay sex.
He insisted he had taken the decision voluntarily and he retained the support of his party.
In a hastily arranged statement, and surrounded by his close colleagues, Mr Farron said he had been “proud” to lead the party for two years but said he could no longer reconcile his strong Christian faith with his responsibilities as leader of the party.
“I have found myself torn, living as a faithful Christian and leading a political party in the current environment,” he said.
The BBC’s chief political correspondent Vicki Young said Mr Farron had spoken at length at the “personal quandary” he found himself in and how he felt questions about his faith had “distracted” from the party’s efforts during the election.
Earlier on Wednesday, shadow home affairs spokesman Lord Paddick quit citing concerns about Mr Farron’s “views on various issues”.
Mr Farron succeeded Nick Clegg in 2015 after the party’s disastrous election result.
The party increased its tally of seats from eight to 12 at last week’s election but its vote share fell and several party figures criticised the campaign.
Possible candidates to succeed Mr Farron include Norman Lamb, who lost a leadership contest to him two years ago, forming business secretary Vince Cable and ex-minister Jo Swinson.