Scottish election: South of Scotland seats decided
Results have been announced for the four Scottish Parliament constituencies in the Borders and Dumfries and Galloway.
In Galloway and West Dumfries there was a victory for Tory Alex Fergusson.
Neighbouring Dumfriesshire returned Labour's Elaine Murray.
In the Borders, Tory John Lamont won Ettrick, Roxburgh and Berwickshire with the SNP's Christine Grahame taking Midlothian South, Tweeddale and Lauderdale.
Mr Fergusson, who served his last term as presiding officer in the Scottish Parliament, admitted he was "hugely relieved" at the outcome in Galloway and West Dumfries where his majority was just 862 votes over the SNP's Aileen McLeod.
"Obviously I am absolutely delighted, I never thought this was in this bag, this particular seat," he said.
"The boundary changes and the obvious swing to the SNP was always going to make it a tight one.
"But I am delighted to have won, my vote has held up remarkably well and I couldn't be happier."
Ms McLeod was also pleased to have run Mr Fergusson so close on a "fantastic night" for the SNP across the country.
"I think we have fought a very positive and constructive campaign," she said.
"I think for us we have increased our share of the vote across Galloway and West Dumfries and I am very happy with that result."
Labour's Willie Scobie was pleased to see his vote rise.
"We came from a position of 5,000 of a vote at the last election in the Scottish Parliament," he said.
"We have increased that to almost 8,000, coming close and chasing the SNP and the Tories - so I am delighted with the outcome."
Lib Dem Joe Rosiejak said: "I am disappointed, I thought we would maybe have done a little bit better but we have been squeezed.
"This is not a great area for Liberal Democrats, but we will bounce back."
In Dumfriesshire, Ms Murray enjoyed a majority of more than 3,000 over Tory Gill Dykes to secure her fourth consecutive term at Holyrood.
"I am delighted to have been returned and to have actually got a larger majority than I had in my previous seat," she said.
"But overall it is a worrying time for Labour in Scotland because we have lost a lot of very good, experienced MSPs.
"I think the main message coming out throughout Scotland is that Scotland rejects the policies of the UK government."
Ms Dykes said she had faced a tough task despite a notional Tory majority in the area after boundary changes.
"Elaine is an incumbent and she has been here for 12 years so you are up against it before you start," she said.
"I am disappointed to come second but pleased with the hard work and effort that the campaign team has put in."
The SNP gained ground in third place with Aileen Orr.
"We are really, really pleased because we were coming from a very low base," she said.
"We would loved to have won but we have shown such a substantial increase that we are really pleased."
Lib Dem Richard Brodie said UK politics had clearly had an impact on his vote.
"I think it is all to do with Westminster," he said.
"It is a sort of backlash on the coalition - I am sure that in two or three years time things will look differently."
In Ettrick, Roxburgh and Berwickshire, Conservative John Lamont secured a majority of more than 5,000 over Paul Wheelhouse of the SNP.
"It has been a tremendous honour to have been the MSP for Roxburgh and Berwickshire for the last four years and it's an honour to be returned," said Mr Lamont.
"I have worked as hard as I possibly could have worked over the last four years and my promise to my constituents going forward is to continue that hard work."
Mr Wheelhouse said: "We were disappointed not to win the constituency with the trend happening around the country.
"But we have had about a 12% swing from the Lib Dems so we are quite satisfied with that."
Lib Dem Euan Robson was third, Rab Stewart of Labour fourth and Independent Jesse Rae fifth.
The Midlothian South, Tweeddale and Lauderdale seat was taken by Ms Grahame with a clear lead of nearly 5,000 over Lib Dem Jeremy Purvis.
"I am delighted to have won the seat from the Liberal Democrats, for the first time in 50 years they are not representing the area," she said.
"And, indeed, Midlothian South is not represented by Labour, so it's a double-whammy, the SNP has taken out Labour and the Lib Dems in this seat."
Mr Purvis said: "The eight years that I have been an MSP and served the Borders have been the most rewarding of my life and that will never be taken away from me.
"Of course it's a huge disappointment but I really am grateful for the support people gave me in this election."
Labour's Ian Miller was third and Tory Peter Duncan fourth.
The South of Scotland list seats returned four SNP candidates (Joan McAlpine, Aileen McLeod, Paul Wheelhouse and Chic Brodie), two Labour (Claudia Beamish and Graeme Pearson) and Jim Hume for the Lib Dems.