Tim Farron, the leader of Britain's pro-European Union Liberal Democrat Party, resigned on Wednesday saying questions about his Christian faith ahead of last week's election meant he felt it was impossible to continue in the role.
"To be a political leader... and to live as a committed Christian, to hold faithfully to the Bible's teaching, has felt impossible for me," he said.
Farron, 47, said he had felt "torn" between political and religious life after facing questioning over whether he agreed with his party's positive view of same-sex unions.
A father of four, Farron was elected leader of the Liberal Democrats in July 2015 after the party -- which had been in a coalition with the ruling Conservatives -- was nearly wiped out in the general election, losing 48 seats.
However, the party created one of the surprises in last week's snap election, increasing their number of MPs from nine to 12, after campaigning for a second referendum on the terms of Brexit.
But Farron's stance on gay rights grabbed headlines very early on the campaign and he was asked to clarify whether he thought being gay was a sin after a 2015 interview resurfaced in which he had given an evasive answer.
Farron said he had concluded that it was impossible for him to stay as leader of a progressive, liberal party and live as a committed Christian despite not seeking to impose his views on others.
"I seem to be the subject of suspicion because of what I believe and who my faith is in," he said. "In which case we are kidding ourselves if we think we yet live in a tolerant, liberal society."
The Liberal Democrats had joined the Conservatives in a coalition government led by David Cameron in 2010 after winning 57 seats. However, five years later they were routed and won just eight.
Farron had said his party would not support either May's Conservatives or the opposition Labour Party in forming a government after last week's election left no outright winner.
He will stay on in his job until the party starts the process of electing a new leader next month. Former Business Secretary Vince Cable and Jo Swinson, who was a junior minister in the coalition government, are the favourites to replace him.