All the pre-race talk had been about her compatriot Dibaba, aiming to add the 5,000 title to the 10,000 she won last week for a second Olympic double-double, and Kenyan world champion Vivian Cheruiyot but Defar upstaged them both, albeit with a relatively slow time of 15:04.25.
"I changed my training this season. After the Diamond Leagues I started doing very focused championship training," the quietly-spoken Defar said.
"I started working on tactics and I've been in very good health, more than ever before and in the race I was able to be a good competitor and get gold.
"For me today was a very important day it was a very special day. There were very few people who really expected me to do well in this race," added the 28-year-old who won the bronze in Beijing four years ago.
Defar became the first woman to win the Olympic 5,000 final twice since its introduction in 1996.
World record-holder Dibaba was running in her third distance race of the London Olympics and her tired legs had no response to Defar's turn of speed over the last 100 metres.
She faded to third as Cheruiyot, who won bronze in the 10,000, also overtook her to cross the line in 15:04.73.
"Today I was two steps behind Meseret and when she pushed, I realised it was way too late but I am satisfied with today," said world champion Cheruiyot.
Dibaba hit the front with four laps to go after a slow, tactical first half followed by Defar, team-mate Gelete Burka Cheruiyot and two other Kenyans who moved up on the outside.
The field started to string out as Dibaba began to test her rivals and at the bell, only Defar, Kenya's Sally Kipyego and Cheruiyot had gone with her.
However, Dibaba's usual searing final lap did not materialise and Defar remained on her shoulder ready to pounce on the home straight.
Defar crossed the line with her arms in the air before kissing a religious picture she had carried in her top and falling to the track weeping.
"Today after eight years I have won gold, it's a great achievement. I feel as if I've been born again. I'm very happy," she said.
"To win gold in one's third Olympics is very tough. I've passed through many difficult times, I've lost out at championships through illness this was a very decisive Olympics for me. I might not contest a fourth Olympics."
Jo Pavey finished a creditable seventh, just ahead of British team-mate Julia Bleasdale.
Again the GB pair were the highest-finishing non-Africans in the race, as they were in the 10,000m final earlier in the Games.
There was a less enthusiastic response as Turkey's Asli Cakir Alptekin, who served a two-year doping ban eight years ago, won a slow women's 1,500m final by searing to a 58-second final lap to finish ahead of team-mate Gamze Bulut.
Ethiopoan-born Maryam Yusuf Jamal of Bahrain was third, with Russia's Tatyana Tomashova fourth. It was easily Cakir's biggest triumph, although she won the European Championship title this season.
The African and Russian favourites were left behind by the Turkish duo after getting their tactics wrong and allowing for a sprint finish - much like the men's race, which was won by Algeria's Taoufik Makhloufi.
Britain's Lisa Dobriskey and Laura Weightman were also run out of it, finishing 10th and 11th respectively.
American Morgan Uceny, who fell in the 2011 world championship final, also hit the deck in London and exited in tears.
Former doper Tatyana Lysenko of Russia won the women's hammer gold with an Olympic record throw of 78.18 metres on Friday but officials were left red-faced after a measuring mistake that caused confusion over the bronze-medal position.
Lysenko, who won the world championship title last year, beat the old Olympic record of 76.34 set by Askana Miankova in Beijing with her first throw of the night, 77.56m, then improved it with her fifth.
Anita Wlodarczyk of Poland took silver with 77.60 and China's Zhang Wenxiu was initially awarded her second successive bronze before Germany's Betty Heidler was promoted to third following a mix-up over the measurement of her fifth throw.
Officials said that although world record holder Heidler's fifth effort was electronically measured it had not been entered into the data system. She was allowed to re-throw, fouling, and was unable to get past Zhang with her sixth attempt.
Zhang, in third place at that point, went into the final round thinking she had the bronze medal. She failed to improve but draped herself in a Chinese flag and did a lap of honour.
However, when officials found Heidler's mark in the grass from her fifth throw it was manually remeasured at 77.13, beating Zhang's 76.34, so the German was awarded the bronze.
Chinese officials immediately appealed against the decision, causing the medal ceremony to be postponed until Saturday.
After more than three hours of deliberation the IAAF atheltics ruling body, decided the result would stand, noting that the electronic measurement of Heidler's throw had been discovered and adjusting her third-place distance to 77.12.
- Related links