Neptune Collonges beat Sunnyhillboy in the closest-ever Grand National finish but a dramatic race was marred by two horse deaths.
The grey, a 33-1 chance ridden by Daryl Jacob, got up in the last stride to win after a photo finish and give champion trainer Paul Nicholls his first win in the big race in 53 runners.
Katie Walsh, bidding to become the first female jockey to triumph, was third on Seabass with Cappa Bleu fourth.
Two horses - Cheltenham Gold Cup winner Synchronised and According to Pete - suffered fatal injuries.
Synchronised, a stable-mate of runner-up Sunnyhillboy, had been seeking to become the first horse to complete steeplechasing's big-race double in the same season but got loose on the way to the start after unseating champion jockey AP McCoy.
He was cleared to race but fell at the sixth fence, Becher's Brook, only to continue for five more fences before suffering a fracture at the 11th fence.
According to Pete suffered a fractured leg when he was brought down after jumping the 22nd fence [Becher's Brook second time round], when On His Own fell in front of him.
Seabass travelled well throughout the race and looked at one stage as though he might make history for Walsh, who was riding for the first time in the four-and-a-half-mile marathon.
Her third place was the highest finish for a female jockey but elder brother Ruby was forced to give up his ride on On His Own on the race after he fell from Zakandar earlier in the day and was stood down for the remainder of the day.
Neptune Collonges and Sunnyhillboy (16-1) came to the fore and tussled for the lead up the straight, before the Nicholls-trained horse took victory on the line. Winning owner John Hales said immediately afterwards the horse, the first grey winner since Nicolas Silver in 1961, would retire.
Cappa Bleu finished fourth with In Compliance in fifth. A total of 15 horses out of the 40 starters completed the race.
A clearly overcome Jacob said: "You can't beat this. I was on a tough horse and I said to Paul that one day I would ride you a National winner.
"That was two years ago and now I've done it."
Nicholls was thrilled to see the 11-year-old win.
"He's probably the best horse we've run in the race," he said.
"He's got great form, he's been placed in Gold Cups, he stays, he's genuine and Daryl gave him a fantastic ride when you analyse where he went. It's absolutely brilliant.
"It's blown Nicky Henderson out of the water now [in the trainers' championship].
"Any good race would do, but this is the race we wanted."
Hales had mixed emotions as One Man, probably the best horse he ever owned, was killed in a fall at the Grand National meeting in 1998.
"When he crossed the line I thought he might have got it," he said. "My first thought was if he has got it Paul has won the trainers' championship. And then I thought thank you Aintree - you know why - many years ago.
"It split the family coming here. My wife was 50-50, my daughter couldn't face it. She has gone show jumping and is overcome with emotion.
"We've nothing against Aintree. We love coming here and this year we've come up trumps."
2012 Grand National
1. Neptune Collonges (D A Jacob) 33-1
2. Sunnyhillboy (R P McLernon) 16-1
3. Seabass (Ms K Walsh) 8-1 Jt Fav
4. Cappa Bleu (Paul Moloney) 16-1
5. In Compliance (N Madden) 100-1