The 20-year-old marksman, a lance corporal in the Coldstream Guards, hit the trigger switch of the device from 930 yards away, causing the bomb to explode.
The blast killed the would-be bomber and five men around him, an MOD spokesman said.
The incident in December in Kakaran, southern Afghanistan, has been disclosed as Britain prepares to leave from the country by the end of the year.
Lt Col Richard Slack, commanding officer of 9/12 Royal Lancers, told The Daily Telegraph the unnamed shooter also prevented another major attack as a second suicide vest packed with explosives was found nearby.
“The guy was wearing a vest. He was identified by the sniper moving down a tree line and coming up over a ditch,” he said.
“He had a shawl on. It rose up and the sniper saw he had a machine gun.
“They were in contact and he was moving to a firing position. The sniper engaged him and the guy exploded. There was a pause on the radio and the sniper said, ‘I think I’ve just shot a suicide bomber’. The rest of them were killed in the blast.”