The Tory candidate, Robert Courts, won the Witney constituency in Oxfordshire by 5,702 votes, with the party's vote share falling from 60 per cent in 2015 to 45 per cent, as the Lib Dems surged past Labour into second.
The Tory majority on the seat was slashed by nearly 20,000 votes.
Liz Leffman polled 11,611 votes as the Lib Dems' share rose from 7 per cent to 30 per cent.
Larry Sanders, the brother of US Democrat presidential runner Bernie Sanders, polled 1,363 votes for the Green Party and was in fourth place after Labour's Duncan Enright.
Witney has had a Tory MP since its creation in 1983.
However, this timeCourts, a barrister and local councillor, saw the majority cut from the more than 25,000 votes Cameron won in the last year's general election.
In his acceptance speech, Courts paid tribute to Cameron as "a great prime minister and a brilliant MP" for the constituency, saying he would strive to "help and represent local people".
The by-election was called after Cameron stood down as an MP following June's Brexit vote and was seen as the first electoral test for the Conservatives since Theresa May succeeded him as Prime Minister in July.
The former television actress received an 85 per cent share of the vote in the seat, which was not contested by other major parties out of respect for Cox, who was shot and stabbed in her West Yorkshire constituency.
"I hope Jo will be proud tonight of our community. We have shown that we stand together with one voice choosing unity and hope," she said.
The remaining nine candidates all lost their 500 pound deposits as they did not receive a big enough share of the vote.
A man has been charged with murdering Cox and is awaiting trial.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹810
1 Year
₹67/Month
Super Saver
₹1,170
2 Years
₹48/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Access to Exclusive Premium Stories
Over 30 subscriber-only stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app