Former Karnataka chief minister Jagadish Shettar lost the Hubballi-Dharwad (Central) seat by a margin of 34,289 votes.
He had run on a Congress ticket when the Bharatiya Janata Party refused to nominate him for the assembly elections.
Mahesh Tenginakai of the BJP, a first-time candidate, defeated Shettar, a six-term MLA.
The former chief minister was denied a ticket for the assembly elections, thus on April 16 he resigned as an MLA for the district of Hubli-Dharwad (Central) and from the BJP.
In the close race, 60,775 people voted for Shettar while 95,064 voted for Tenginkai.
Siddalingeshgowda Mahanthavadeyar, a candidate for the secular Janata Dal party, received 513 votes, putting him in third place.
B L Santhosh, general secretary of the BJP’s Organisational Wing, is said to be close to Tenginkai.
In the 2018 assembly elections, Shettar won his sixth seat after defeating Congress candidate Mahesh Nalwad by a margin of 21,306 votes in the Hubballi-Dharwad (central) constituency.