Dr Harris said it was a "great disappointment"
Liberal Democrat Evan Harris has lost the seat for Oxford West and Abingdon to Conservative Nicola Blackwood.
In a surprise defeat Dr Harris, who took the seat from the Tories in 1997, polled 23,730 votes - only 176 less than Ms Blackwood's 23,906 votes.
The count was so close that the votes had to be recounted.
Dr Harris, who said opponents had told untruths against him during the campaign, said the result was a disappointment but he would come back.
During the campaign, Dr Harris criticised an opponent's leaflet campaign describing him as "Dr Death".
The Animal Protection Party claimed Dr Harris had an "enthusiasm for euthanasia", but Dr Harris dismissed the attack as "disgraceful".
Tory MP Nicola Blackwood sings live on BBC Oxford radio
Ms Blackwood said: "I feel rather elated; I have to say this wasn't the result I expected when I came over in the car this evening.
"It has been rather a tense evening. We've had several recounts but when it comes down to it this was a seat where every single vote counted."
Ms Blackwood then fulfilled a promise to sing live on air on BBC Oxford.
Earlier in the night she promised she would sing if she won - after fellow Tory MP Ed Vaizey revealed she was a trained opera singer.