The Qatari, who has handed the keys to his Citroen DS3 WRC this weekend in Finland to Australia's Chris Atkinson, took third place in London in the men's skeet.
Competing in his fifth Olympics, Al-Attiyah went into the final fourth after scoring 121 out of 125. He then shot 23 of his 25 targets in the final tie for third Russian Valeriy Shomin.
In the shootout for the medal, Al-Attiyah hit all of his targets, while the Russian missed just the one.
“I feel really fantastic,” said Al-Attiyah.
“I have been two times in the final and in Athens I was in a shoot-off for a bronze medal and I lost.
“I am so happy with this medal and I think my country is so happy about this. It is fantastic.
Al-Attiyah became the first medallist from the Middle East of the London Games.
“Shooting I cannot practice because I am always travelling, around 270 days,” said Al-Attiyah.
“I came here and shot maybe one week or 10 days before.
“It is completely different feeling because Olympics is every four years and Dakar rally you can do every year.
“I learn and I take a lot from rally about how I can fight and this is what I did here.”