Dave Hodgson is the leader of Lib Dem group on Bedford Borough Council
The Liberal Democrat candidate has been declared the newly elected mayor of Bedford after beating the rival Conservative candidate in the run-off.
Lib Dem group leader on Bedford council Dave Hodgson won in the second stage of the count against rival Tory candidate Parvez Akhtar.
Four candidates were knocked out after the first count.
Mr Hodgson will replace the town's first elected mayor, independent Frank Branston, who died in August, aged 70.
Mr Hodgson, who will be 50 on Wednesday, has lived in Bedford since the age of nine.
Mr Hodgson scooped 9,428 votes in the first round of the elections, with Tory candidate Mr Akhtar getting 9,105.
But after counts of voters' second preferences, the leader of the Lib Dem party in Bedford gained 4,127 votes to his opponent's 2,438.
Cheers from his supporters drowned out the declaration when the result was announced at Bedford's Corn Exchange.
Frank Branston was first elected as mayor in 2002
The victory, which comes just days after Bedford was visited by party leader Nick Clegg, makes Mr Hodgson one of the most powerful Lib Dems in the country, controlling the unitary authority's multi-million pound budget.
His party already controls the council, holding 13 seats compared to nine Conservatives, seven Labour and seven independents.
Speaking after his election, Mr Hodgson said: "I'm elated, and a bit nervous. It's a huge task to take on.
"We've got to get moving straightaway, there's no time to waste.
"This is a great result for the Lib Dems but there's an awful lot of work to be done."
The eliminated candidates included independent Apu Bagchi who received 7,631 votes, and fellow independent Tony Hare who got 4,316 votes.
Green Party candidate Eve Robinson-Morley gained 1,183 votes, with Labour hopeful James Valentine getting 3,482 votes.