David Mundell has been sacked as Scottish secretary by Boris Johnson as the new prime minister reshapes his cabinet team.
Mr Mundell had served in the post since May 2015, but had opposed Mr Johnson's bid to become prime minister.
Mr Mundell tweeted that he was "disappointed but not surprised" to be leaving the Scotland Office.
Scottish Conservative leader Ruth Davidson said his record as Scottish secretary had been "exemplary".
She added: "He has been a trusted adviser to two prime ministers, held his nerve during the independence campaign and faced down Nicola Sturgeon when she called for a re-run in 2017".
Dumfries and Galloway MP Alister Jack was later appointed to take over the role.
Mr Mundell told BBC Scotland News: "Mr Johnson made it clear he wanted a cabinet in his own mould - I'm clearly not in that mould.
"I've never been a cheerleader for him, which is well documented.
"I was prepared to work with him because my overriding priority is keeping Scotland in the United Kingdom and making sure that we deliver a Brexit that's best for Scotland."
In a tweet, Mr Mundell pledged to continue to support the government from the backbenches, but said he had told Mr Johnson on Wednesday afternoon that he would also "hold him to account on his commitments to the Union".
Mr Mundell has been the MP for Dumfriesshire, Clydesdale and Tweeddale in Scotland since 2005, and served as a junior minister in the Scotland Office before being appointed to the cabinet as Scottish secretary by David Cameron.
He became the first openly-gay Conservative cabinet minister when he came out in January 2016.
Mr Mundell was said to have been heavily involved in a Scottish Conservative attempt to prevent Mr Johnson becoming prime minister in 2016.
He told BBC Scotland last year that it would be "extremely difficult" for him to stay in the cabinet if the former foreign secretary ever did make it to 10 Downing Street.
He had faced calls to resign from SNP and Labour MPs at Scottish Questions in the Commons on Wednesday morning, with the SNP's Pete Wishart urging him to "have some backbone" and quit his post.
Mr Mundell backed Remain in the EU referendum and initially supported Health Secretary Matt Hancock in the Conservative leadership contest, before switching to Michael Gove.
I hear there’s more time for this sort of thing on the backbenches 🍻 pic.twitter.com/5KWDEbncCJ— David Mundell (@DavidMundellDCT) July 24, 2019
His departure came as Mr Johnson started to unveil a major overhaul of the government's ministerial team shortly after accepting the Queen's invitation to become prime minister following the resignation of Theresa May,
Sajid Javid becomes chancellor and Priti Patel home secretary, while more than half the previous cabinet, including leadership rival Jeremy Hunt, have quit or been sacked.
In a speech outside 10 Downing Street earlier on Wednesday afternoon, Mr Johnson described the nations of the United Kingdom as the "awesome foursome that are incarnated in that red, white, and blue flag.
"Who together are so much more than the sum of their parts, and whose brand and political personality is admired and even loved around the world."
The new prime minister claimed to have "every confidence" that he would be able to agree a Brexit deal with the EU ahead of the UK's departure debate on 31 October.
But Mr Johnson insisted that the UK would definitely be leaving the EU on that day "no ifs, no buts", adding "the buck stops here".
Scottish First Minister Nicola Sturgeon claimed that his speech was "rambling, blame-shifting and, to put it mildly, somewhat divorced from reality".