The Conservatives have claimed the councillor vacancy in Mid Galloway and Wigtown West ward.
In a count at the County Buildings in Wigtown on Friday Richard Marsh comfortably held off a challenge from the SNP’s Ian Gibson.
Voting had taken place the previous day and turnout was low – just over 30 per cent.
Mr Marsh polled 1,787 first preference votes to Mr Gibson’s 879.
Labour’s John Peter McCutcheon was third with 326 votes. Iain McDonald of the Lib Dems secured 190 votes and Daniel Hooper-Jones of the Scottish Greens 172.
The by-election was sparked by the resignation of Labour’s Sandy Whitelaw.
The election of Mr Marsh restores the ward to its full councillor complement of four.
The 42-year-old poultry farmer from Kirkcowan said: “It was quite a comprehensive win and I think the size of the majority was somewhat unexpected. I am delighted to be elected as a councillor.”
The leader of the council’s Tory group, Gail Macgregor, congratulated Mr Marsh on his election success.
“I very much look forward to welcoming Richard to our vibrant and talented group on the council. Richard brings with him invaluable knowledge of the area and I know will work tirelessly to help improve the lives of people in his ward as well as across Dumfries and Galloway.”
She added: “We continue to be the largest group on the council and I’m delighted to have a 17 strong dynamic team. Labour have dwindled to a mere eight councillors and are simply now clinging onto power in this SNP/Lab/Ind coalition.”