Ashley Bowkett topped the poll in Barnwood while Sebastian Field won Podsmead by just three votes after a recount.
The by-elections were held on July 25 following the death of Conservative Councillor Lise Noakes in Barnwood and the resignation of Labour Councillor Deborah Smith in Podsmead.
The by-elections saw the Brexit Party, recently formed by Nigel Farage, field its first local election candidates and got comprehensively beaten.Sebastian returns to the city council having previously represented Kingsholm and Wotton for nine years until 2016.
Councillor Jeremy Hilton, leader of Gloucester Liberal Democrats, said: “A Double Gloucester victory and congratulations to our two new city councillors.
“Not only did we see off the Brexit Party in their first council elections, but we gained a seat from the Conservatives and the other one from Labour.
“Ashley Bowkett’s win in Barnwood now secures the second seat in this ward for the Lib Dems.
“In Podsmead we took the seat by just three votes over the Tories in what was a Labour seat. Sebastian Field worked exceptionally hard to secure this win.
“The two wins now mean that the Conservatives have 21 seats and the Liberal Democrats and Labour both have nine councillors each.
The Podsmead result:
Sebastian Field (Lib Dem) 203
Conservatives 200
Labour 122
Brexit 111
Green 29
UKIP 11
Turnout 32%
The Barnwood result
Ashley Bowkett (Lib Dem) 676
Conservative 496
Brexit 152
Labour 64
Green 59
UKIP 6
Turnout 29%