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 he said he could no longer reconcile his strong Christian faith with his responsibilities as leader of a liberal party.
"The consequences of the focus on my faith is that I have found myself torn between living as a faithful Christian and serving as a political leader," he said.
"A better, wiser person may have been able to deal with this more successfully, to remain faithful to Christ while leading a political party in the current environment.
"To be a leader, particularly of a progressive liberal party in 2017 and to live as a committed Christian and to hold faithful to the Bible's teaching has felt impossible for me."
This is really sad and tragic. It was always going to be a struggle for an Evangelical Christian to lead a party as politically correct as the Liberal Democrats, but you have to admire him for trying, even if he didn't have the courage to say what he really thought on the old gay sex question that tripped him up.
I feel the same sense of awkwardness. My politics is very much that of a metropolitan liberal, until questions of human sexuality come up.
I fear that many more Christian politicians are going to be hounded out like Farron was.