Shelley, who won silver four years ago in Delhi, became the first Australian to win the Games marathon for 20 years and the first to claim consecutive medals in the event since Steve Moneghetti in 1990 and 1994.
Kenya's Stephen Chemlany clinched silver and Abraham Kiplimo of Uganda took bronze, both winning the first medals for their countries in Glasgow.
It was also Uganda's first Games medal ever in the men's marathon.
Blake suffers shock defeat as Simbine takes gold in 100m
More Kenyan medals followed soon afterwards when Daniel capped an excellent performance to win gold ahead of compatriot Caroline Kilel.
Australia Jess Trengove added to her country's burgeoning medal tally when she crossed the line for bronze to cheers from a large crowd on a drizzly day in Scotland.
"I've got to pinch my self, it is very exciting," Shelley told reporters.
"To come back and actually win is indescribable. Now I have had a bit more experience, to come away with my first win is indescribable.
"You just try to run the best you possibly can and it was a dream to be honest. I'm still buzzing, I can't believe it. It probably wasn't until a kilometre out that I got a bit of a feeling.
"I just kept pushing on. My main idea was to stay relaxed and I was always there in the lead group. At 35 kilometres there was a surge. I just had to stay strong and it paid off."
Gemili pulls out of Commonwealth Games 100m final with injury
Scott upsets Chalmers to win 100m freestyle title