The 37-year-old, who recently signed for Hibs, was one of four keepers in Steve Clarke's squad for the current round of fixtures but has decided to call it a day in the wake of the World Cup play-off defeat by Ukraine last week.
Marshall, who was the penalty shootout hero against Serbia in November 2020 as Scotland qualified for Euro 2020, believes now is the right time to step aside and let younger contenders like Zander Clark and Liam Kelly stake a claim to replace regular number one Craig Gordon.
"I have thought long and hard about it since the disappointment of losing to Ukraine," he told the Scottish Football Association. "I love playing for my country and the experience of helping the team to a major tournament has been the highlight of my career.
"I have memories of playing for Scotland that will last a lifetime but I also know what it is like as a young goalkeeper to have the opportunity.
"That was the overriding factor in my decision: Liam and Zander have been involved in recent squads for a while now and it is important that they can benefit from the experience of supporting Craig as No.1.
"The more I thought about it since the weekend, the more I was convinced it was the right thing to do before we start the Nations League campaign."
Marshall retires with 47 caps to his name. He made his debut in a friendly against Hungary in 2004 and his final appearance proved to be the defeat by Croatia at last summer's Euros.