Lib Dem Sarah Green is the country's newest MP after winning the seat, which had been a Conservative stronghold since its creation in 1974.
Sir Ed Davey the Lib Dem leader, said the result sent a "shockwave through British politics" by showing that the "Blue Wall" of Tory southern seats could be vulnerable.
The Tories sought to limit the damage, insisting it was difficult for governing parties to win by-elections, but defeated candidate Peter Fleet acknowledged the Conservatives had to rebuild "trust and understanding" with voters.
The contest was triggered by the death of former Cabinet minister Dame Cheryl Gillan, who took the seat with a majority of 16,233 in the 2019 general election - some 55% of the vote.
In a stunning result, Ms Green took 56.7% of the vote to secure a majority of 8,028 over the second-placed Tories.
"This Conservative Party has taken people across the country for granted for far too long," Ms Green said.
The Green Party came third with 1,480 votes, with Labour trailing in fourth with just 622 votes, losing the party's deposit in the process.
In her acceptance speech Ms Green said: "Tonight the voice of Chesham and Amersham is unmistakable. Together we have said, 'Enough is enough, we will be heard and this Government will listen'.
"This campaign has shown that no matter where you live, or how supposedly safe a constituency may appear to be, if you want a Liberal Democrat member of Parliament, you can have a Liberal Democrat Member of Parliament."
She added: "We will continue the work of holding this Government to account for letting Covid rip through the care homes. We will speak up for the three million people excluded from financial support throughout the pandemic and we will challenge Boris Johnson to be far more ambitious in tackling climate change, supporting our frontline workers and backing our small businesses."
The scale of the defeat will ring alarm bells in Conservative Campaign Headquarters (CCHQ).
Major issues in the campaign included the HS2 rail line, which cuts through the constituency, and the Government's proposed planning reforms which have sparked fears about building in the countryside around the seat in the Chilterns.
Mr Fleet said: "Clearly this was a very disappointing result, not the result that I was expecting nor my team."
He added: "It's an absolutely extraordinary result which must take into account the fact that the Liberal Democrat party didn't just throw the kitchen sink at this constituency, I think it was the microwave, the table, the oven, the dishwasher, the dog, the cat and anything else that was lying around as well."
Tory chairwoman Amanda Milling said the "work starts now to show how it's Conservatives that can deliver on the people's priorities and regain their support".
A Conservative source said: "By-elections are always difficult for the governing party, particularly 11 years into government, but there is no getting away from the fact this is a very disappointing result."
The victory caught bookmakers off guard - the Tories were firm favourites and the Lib Dems closed at 4/1 with Ladbrokes.
"Fair to say this was a night for the punters," the firm said.