Conservative candidate David Duguid is the new MP for Banff and Buchan.
The north-east seat has been held by the SNP since 1987 – first by former first minster Alex Salmond, and most recently Eilidh Whiteford.
She won just over 60% of the vote in 2015, giving her a majority of more than 14,300.
Mrs Whiteford hit the headlines in recent months with her Bill to get the UK Government to ratify the Istanbul Convention on violence against women and girls.
Actress Emma Watson threw her support behind the north-east MP’s crusade and wrote to all MPs, urging them to attend the final Commons stages of draft legislation brought forward by the former Banff Academy pupil.
This morning Mr Duguid took 48% of the vote with 19,976 while the SNP candidate got 16,283 votes.
Labour candidate Caitlin Stott got 3,936 votes and 1,448 votes went to Liberal Democrat candidate Galen Milne.
Eilidh Whiteford loses Banff and Buchan seat to Conservatives