Racing the final leg, Sweden's Charlotte Kalla somehow found the energy to produce a turbo-charged sprint in the final straight, to overtake Krista Lahteenmaki of Finland and Germany’s Denise Hermann.
That sparked scenes of wild celebration at the finish line, as an exhausted Kalla was jumped on by her jubilant and incredulous team-mates.
Sweden finished on 53 minutes 2.7 seconds, with Finland taking silver 0.5 seconds behind. The German quartet took bronze on 53 minutes 3.6 seconds.
Third Sochi medal for modest Kalla
The Sochi Games are turning into a personal triumph for Kalla, who by Day 7 had already won three medals, more than any other athlete.
The Swede took silver in both the skiathlon and the 10km classic time trial. Her one previous taste of Olympic gold came in the 10km freestyle time trial at Vancouver 2010.
Refusing to take the credit for a famous victory, Kalla modestly paid tribute to her three relay teammates Ida Ingemarsdotter, Emma Wiken and Anna Haag.
“Emma stayed in front of the whole group and Anna, she's the real fighter. I was so motivated when I got out on my lap,” she said.
“I cannot believe we're Olympic champions.”
Haag however had no doubts about the debt owed by the team to its leader: “When we were waiting for Charlotte in the finish area I could barely believe it. It was crazy,” she said.
“Charlotte was skiing like a god.”
It was the first time Sweden have won gold in the women's Olympic relay since the 1960 Games in Squaw Valley. The last time they even won a medal in the event was in 1968.
Kalla now has a total of five Winter Games medals. Only one Swedish athlete has bettered that total Alpine skier Anja Paerson who won six.
Meanwhile, there was heartbreak for favourites Norway who could finish only fifth, 53.6 seconds off the pace.