The prime minister said it was "too early to say" the final result but he hoped to form a government.
Labour has been wiped out by the SNP in Scotland and is failing to make enough progress in England and Wales.
The Lib Dems are heading for as few as 12 MPs, with Vince Cable, Ed Davey and Danny Alexander losing their seats.
The BBC forecast, with well over half of the results now in, is Conservative 325, Labour 232, the Lib Dems 12, the SNP 56, Plaid Cymru three, UKIP two, the Greens one and others 19.