American teenager Mikaela Shiffrin became the youngest ever Olympic slalom champion with victory over Austria's Marlies Schild by 0.53 seconds.
Shiffrin, the world champion and World Cup leader, led after the first run and pulled off a remarkable recovery from a mid-course mistake to post the sixth quickest second-run time for a winning aggregate of 1:44.54.
Austrian Kathrin Zettel was third.
"This has been a dream of mine for a very long time," said Shiffrin, 18.
"It is one of most special days of my life. Winning a gold medal at the Olympics is one thing but to share it with these two [Schild and Zettel] - they were my idols as a youngster growing up - I'm really happy."
Under the floodlights above Rosa Khutor village, defending champion Maria Hoefl-Riesch of Germany was second after run one but slipped to fourth overall, while double Sochi gold medallist Tina Maze faded from third to eighth.
Shiffrin became the youngest American alpine skiing medallist and the first woman from her country to win a slalom medal since Barbara Cochran's triumph in Sapporo in 1972.
She also became the youngest alpine skiing gold medallist in 30 years, after Switzerland's Michela Figini, who won the women's downhill aged 17 in Sarajevo in 1984.
Schild, 32, who climbed from sixth after run one, is the first woman to win an Olympic slalom medal at three Games, having won bronze in Turin in 2006 and silver in Vancouver in 2010. She also won combined silver in Turin and equalled the Austrian record of four Olympic medals, held by Hermann Maier, Stephan Eberharter and Benjamin Raich.
The 27-year-old Zettel, the 2009 super-combined world champion, won her first Olympic medal after previously finishing fourth twice.
Riesch also won gold in the combined and silver in super-G in Sochi to finish her Olympic career with three golds and one silver in all.
The 29-year-old retires equal third in the list of all-time female Olympic alpine medallists behind joint leaders Anja Paerson of Sweden and Croatia's Janica Kostelic, who won six.