Congress secured 40.8 per cent of the votes as against BJP's 43 per cent, up from 41.63 per cent in 2009 Lok Sabha polls, an analysis of the voting percentage showed.
In the last Lok Sabha elections, BJP had secured 19 seats, Congress six and JD(S) 3.
It is a remarkable turnaround for BJP which had polled 19.9 per cent of the votes in the May 2013 assembly polls that brought down the party's first ever government in the South.
JD(S) led by former Prime Minister H D Deve Gowda secured 11 per cent voting share, down from 13.57 it had got in the last Lok Sabha polls. The party won two seats.
Also Read
Aam Aadmi Party, which had aimed to gain a toehold in Karnataka by contesting across the state, has put up a miserable show with a mere 0.8 per cent vote share.
Independents secured 1.6 per cent vote share, a drop from 4.12 in the 2009 parliamentary polls.
The party has derived much of the strength from north Karnataka.
JD(S) has been confined to its traditional Vokkaliga stronghold in Hassan and Mandya.
The Lok Sabha poll outcome has come as a dampener for the Congress which, hoping on the goodwill in the assembly polls, had set an ambitious target of winning about 18 to 20 seats.
Chief Minister Siddaramaiah himself admitted it was a "setback".
Months ahead of the Lok Sabha polls, BJP had made it clear that it was banking on the Modi magic to do the trick for its turnaround in its fortunes.