The Scotland Office minister saw off the SNP tsunami to win the seat with 20,759 votes and a slightly increased share of the ballot.
The SNP, who had been fourth in 2010, came second this time round with candidate Emma Harper securing 19,961 votes.
It gives the Conservatives a majority of 798 but the narrow margin of victory will not matter to the party faithful, some of whom had written off the seat at the South Lanarkshire count where the Nationalists had swept the board.
While both Labour and the Liberal Democrats have lost seats in Scotland, the result means the Conservatives have at least matched their tally from the last General Election.
Speaking afterwards, Mr Mundell said: “I think it is quite clear in this constituency people did want an MP who represented their views in relation to the future of our United Kingdom and I do think the economy did play an important part as well.
“I think people wanted the stability that a Conservative or Conservative-led government would bring.”
Labour’s Archie Dryburgh was a distant third with 7,711 votes, with UKIP’s Kevin Newton in fourth, ahead of Lib Dem Amanda Kubie and Green candidate Jody Jamieson.
The turnout was a massive 76.2 per cent.