More upsets

The Lib Dems have overturned Zac Goldsmith's 23,000 majority from 2015 to win the Richmond Park by-election. Here's a look at some famous and infamous by-elections of the recent, and not-so-recent, past.

Winston's loss - Oldham, 1899

Image copyrightGetty Images

The contest is best remembered for being the first time Winston Churchill, then 25, ran for Parliament. The by-election was called after one of Oldham's two Conservative MPs died and the other retired due to ill health.

Mr Churchill, a future prime minister, lost with the Liberals taking both seats. He later remembered this had left him "with those feelings of deflation which a bottle of Champagne represents when it has been half-emptied and left uncorked for a night".

But he became one of Oldham's MPs the following year, launching one of the most eventful careers in UK political history.

Liberal bounce - Orpington, 1962

Image copyrightGetty Images

The Liberal Party had a terrible time of it during the mid-20th Century. In the 1951 general election it polled just 2.5% of the UK vote. This rose to 8.5% by the 1966 election, won convincingly by Labour.

So it was with some surprise that Liberal Eric Lubbock won Orpington two years later with a majority of 7,855, a swing of nearly 22% away from the Conservatives.

"There is not a safe Tory seat in the country," Mr Lubbock declared.

But Lord Aldington, vice-chairman of the Conservative Party, said: "I am quite certain the Conservative Party will not be shaken by [this result]. We shall march on and win the next general election."

He was proved right. Edward Heath entered Downing Street with a smallish majority.

SNP breakthrough - Hamilton, 1967

Image copyrightGetty Images

The SNP's Winnie Ewing took the Lanarkshire seat from Labour with a 37.9% swing.

In her acceptance speech, she said: "Stop the World - Scotland wants to get on."

The victory was seen as highly important in the pro-independence SNP's gradual rise to its current predominance in Scotland.

Alex Salmond, later party leader and Scottish First Minister, said: "I think we can safely say that woman changed Scottish history."

SDP wins - Crosby, 1981

Image copyrightGetty Images

The Social Democratic Party (SDP), set up in 1981 by the breakaway "gang of four" Labour politicians, pulled off several by-election victories over the next few years.

Crosby, on Merseyside, was the first with former cabinet minister Shirley Williams - one of the gang - winning by a majority of more than 5,000, overturning a Conservative majority of more than 19,000 at the 1979 general election.

The Tories took back the seat at the 1983 general election.

Bitterness in Bermondsey, 1983

Won by Liberal Simon Hughes, the contest for this south London seat is remembered for its rancour. The openly gay Labour candidate, Peter Tatchell, claimed he had been smeared, with campaign literature describing Mr Hughes as "the straight choice".

There was a huge swing - 44.2% - from Labour to the Liberals.

In 2006, Mr Hughes, who is himself bisexual, told BBC Two's Newsnight: "I hope that there will never be that sort of campaign again. I have never been comfortable about the whole of that campaign, as Peter knows, and I said that to him in the past."

He added: "Where there were things that were inappropriate or wrong, I apologise for that."

Barnes storming - Greenwich, 1987

This by-election, coming in February - just four months before the general election of that year - saw the SDP's Rosie Barnes take the south-east London seat with a 16.2% swing away from Labour.

Prompted by the death of MP Guy Barnett, the contest was a notable setback for Labour leader Neil Kinnock, who was attempting to modernise his party to make it more appealing to centrist voters.

Ms Barnes held on to the seat in the general election, but lost it to Labour in 1992.

No need for a recount - Winchester, 1997

As Tony Blair's Labour swept into power after 18 years in opposition, one of the seats the Conservatives lost in the 1997 general election was Winchester, in Hampshire.

The trouble was that Liberal Democrat Mark Oaten's declared margin of victory was just two votes. There were several recounts and the result was disputed. In October, the High Court declared it void, prompting the by-election.

Seemingly unhappy at being asked to cast a ballot for a second time, the electors of Winchester returned Mr Oaten with a majority of 21,556.

Davis is back - Haltemprice and Howden, 2008

Image copyrightGetty Images

Former shadow home secretary David Davis caused huge surprise when he resigned as a Conservative MP. He ran again on a platform of defending "British liberties", having been critical of the Labour government's anti-terror legislation.

Both Labour and the Liberal Democrats declined to put up a candidate. Mr Davis returned as Conservative MP with a 15,355-vote majority.

He accused Labour of "spectacular cowardice", but Home Office minister Tony McNulty called the by-election "a vain stunt that became and remains a farce".

At last, a Tory gain - Crewe and Nantwich, 2008

Image copyrightGetty Images

Two years ahead of re-entering power in coalition with the Liberal Democrats, the Conservatives scored their first by-election gain in 26 years.

Edward Timpson won a 7,860-vote majority in the seat long held by Labour's Gwyneth Dunwoody. Her daughter, Tamsin Dunwoody, was the party's candidate.

Conservative leader David Cameron called it a "remarkable victory", warning: "But I know that winning a by-election and winning a general election are two different things and we've still got a huge amount of work to do."

Galloway's 'spring' - Bradford West, 2012

Image copyrightGetty Images

Respect's George Galloway stood at the podium and told those gathered in the hall they had witnessed "the most sensational result in British by-election history, bar none". It was the start, he added, of the "Bradford spring".

Mr Galloway, expelled by Labour in 2003, beat his old party by 10,140 votes. At the 2010 general election, Labour's Marsha Singh, who resigned on health grounds, had won with a majority of 5,763 .

Labour leader Ed Miliband said: "We should have won this by-election and I am very disappointed we did not."

But in the 2015 general election, Labour's Naseem Shah took back the seat with a 11,420 majority.