It was a decreased majority for the Tories, however, as the SNP’s Paul Wheelhouse recorded the highest ever number of votes for the party in the constituency in Scottish Parliament elections.
The turnout for the constituency was down slightly from the 69.8% in the 2017 by-election, when Mrs Hamilton first won the seat, with 64% this time round.
Mrs Hamilton said: “We have done very well in the election today.
"People have come out to vote, they have put their cross next to the Scottish Conservative Party and they have rejected divisiveness, and want to rebuild from the pandemic, protecting jobs and livelihood and grow the economy.”
Second-placed Paul Wheelhouse said: “We had hoped for better, but it’s the largely same pattern as the last time at the by-election.
"The vote is up slightly, but I hope we see an SNP government delivering progressive policies for the people of Ettrick, Roxburgh and Berwickshire, whether I am representing them or not.”
Mr Wheelhouse, who served as minister for business, f air work and skills in the last parliament, now faces an uneasy wait to see if he still has a job when the South of Scotland party list results are announced tomorrow. He is third on the party list.
There was a small victory for the Liberal Democrats, with their candidate Jenny Marr leapfrogging Labour’s Ian Davidson into third place, with the Green Party’s Barbra Harvie taking fifth and independent candidate Jesse Rae pulling in 290 votes.
Rachael Hamilton, Scottish Conservative and Unionist Party – 18,564
Paul Wheelhouse, Scottish National Party (SNP) – 11,701
Jenny Claire Marr, Scottish Liberal Democrats – 2,352
Ian Davidson, Scottish Labour Party and Scottish Co-operative Party – 2,050
Barbra Harvie, Scottish Green Party – 1,084
Jesse Rae, Independent - 290
The count for the Midlothian South, Tweeddale and Lauderdale constituency takes place tomorrow, also at Kelso.