The Congress won the Jayanagar assembly seat in the city by a margin of more than 2,800 votes, wresting it from the BJP.
According to election officials, Congress' Sowmya Reddy secured 54,457 votes against her nearest rival from the BJP, B.N Prahlad, who managed 51,568 votes.
Assembly elections were held across the state on May 12, but the polling on Jayanagar seat was countermanded owing to the death of BJP candidate B.N Vijayakumar, who was holding the constituency.
The by-poll was held on June 11.
Ahead of the polling, the Janata Dal (Secular) had on June 5 pulled out its candidate from the contest and extended the party's support to its ruling coalition partner, the Congress.
This was the first election after the JD(S)-Congress combine came to power in the state in which they put up a united fight against the BJP.
Both Congress and JD(S) had fielded candidates against each other, despite being coalition partners, in the recent election to the Rajarajeshwari Nagar Assembly seat in the city.
Congress's Munirathna had won the seat, relegating the JD(S) candidate to a distant third behind the BJP.