One For Arthur became just the second Scottish winner of the Grand National after surging clear of the chasing pack at the last jump.
Joint-favourite Blaklion was in a great rhythm and took the lead with three to jump at Aintree, but was unable to last the pace as jockey Derek Fox, who had not raced since March 9 after injuring himself in a fall at Carlisle, rode a perfect race to hit the front on One For Arthur.
The Lucinda Russell-trained eight-year-old, which went off at 14-1, jumped over the last with Cause of Causes before steaming clear to win by three lengths.
"I was injured on 9 March, I got a heavy fall on the novice chase and that was four weeks ago on Thursday," Fox said.
"This is the best feeling I have ever had or probably ever will have and I want to take most of it in. I don't often get a chance to ride a horse as good as that."
The betting suggested it would be a tight race, with Blaklion and Definitly Red going as favourites.
However, Definitly Red was pulled up early after his saddle appeared to slip and it was Roi Des Francs that took up the running with Rogue Angel and Good To Know for company.
Blaklion, whose trainer Nigel Twiston-Davies was searching for a third National victory, took up the running and appeared to be en route to victory.
However, the eight-year-old - ridden by Noel Fehily - ran out of steam and eventually finished fourth.
And it was Fox that was rewarded for riding a patient race as One For Arthur judged the last fence perfectly and steamed ahead of Cause of Causes to clinch the victory, with Saint Are - second on his last National start - in third.
A thrilled Russell told ITV Sport: "That was amazing, I'm tearful but it is amazing.
"It's total credit to Derek, he never panicked. I have just won the National!"
It was later reported that all 40 runners came back unharmed.