The six-time London Marathon winner clocked one hour 30 minutes and 20 seconds to beat Marcel Hug of Switzerland into second place by a second, with defending champion Kurt Fearnley of Australia taking bronze, also a second behind Weir.
And Shelly Woods followed him home in style with silver in the women’s marathon, Britain’s last medal of London 2012, taking their final tally for the Games to 120 – 34 golds, 43 silvers and 43 bronzes.
Weir, who had already collected golds in the T54 800m, 1500m and 5000m, rounded off his London 2012 campaign a with a sprint finish along The Mall that left his opponents battling it out for silver and bronze.
On the track, Weir proved unbeatable and even though he started the marathon as a red-hot favourite in the red-hot conditions, his competitors were determined not to let him has his way.
"Everyone was working together to stop me but I'm used to that and I do my own thing and race as best as I can," he said.
"It was tough, the first five miles I was just dying and felt really flat and I didn't think I could do it.
"It was the toughest race of my life. I really had to dig deep but I knew I had lots of top speed and that I was rolling a lot better than the other guys.
"I just sprinted as hard as I could at the finish. I thought I might have gone too early but I just pushed with everything I had and when I had a sneaky look back I realised I'd won it.
"Emotionally it will probably take forever to recover from this. I don't know how long it will take to recover physically, it depends on how many beers I have.
"The crowd were awesome for the whole race. My whole body was tingling and they got me through with their support."
Silver for Woods was a major relief after her failure to make the podium in three track races and she crossed the line just one second behind gold medallist Shirley Reilly of the USA.
It was a terrific finish for Woods, who just missed out on a marathon medal in Beijing four years ago, coming fourth.
“I can’t describe how great it feels. That was such a hard race, probably the hardest marathon I’ve ever pushed in my life," she said.
“It’s been such a tough week mentally. Physically my speed has been the best it’s been for the past few years, but the other girls were better tactically on the track.
“I still had the speed to sprint for the finish after 26 miles. It hurt, but all the hurt was worth it now.
“I wanted this so badly. I’ve been training for this for four years. To get a silver medal in London is amazing. It’s fantastic.”