The 32-year-old Hansdotter clocked an aggregate of 1min 38.63sec, Switzerland's Wendy Holdener taking silver at 0.05sec and unheralded Austrian Katharina Gallhuber bronze (+0.32).
Shiffrin, who initially complained of virus-like symptoms and was sick at the start gate before a disappointing first leg, was 0.40sec off the pace and will miss Saturday's super-G.
She later played down that bout of sickness as “more nerves than anything”.
“I don't feel sick right now, I don't think I have a virus. I was thinking that after the first run, but I think it was me making an excuse.”
Gold medallist Frida Hansdotter with silver medallist Wendy Holdener and bronze medallist Katharina Gallhuber. Photo: AP Photo/Jae C Hong
Shiffrin, who confirmed she would skip the super-G, added: “I don't really have any particular excuses. I've been skiing aggressively in slalom all season long, I've been confident, comfortable.”
“So coming here and skiing the way I did, conservatively, is a huge disappointment. But that's how life goes.”
“I know I have the best slalom turns in the world but I didn't put it out in the two runs that mattered.”
“Sometimes I think the only person who can beat myself in the slalom is me and I beat myself in the wrong way today and that's a really big bummer.”
The 22-year-old had come in fourth, 0.48sec behind Holdener, on the first run.
Dark-horse Gallhuber, just 20 and only ninth-fastest first time out, laid down a stunning second run to put herself in pole.
The Austrian held off Shiffrin and Sweden's Anna Swenn Larsson, but then saw Hansdotter and Holdener leapfrog her as they kept their nerve down the Rainbow 1 course in bitterly cold, bright conditions.
Hansdotter's gold tops a career that has seen her win just four World Cup races and three slalom medals at world championships (silver 2015; bronze 2013, 2017). She follows Anja Pärson as the second Swede to have won the Olympic title, the first coming in the 2006 Turin Games.
Her consistency ultimately came right as she skied the second fastest runs on both occasions in front of a sparse, wind-swept crowd.
“I knew it would be tough, Mikaela has been so strong this season,” said Hansdotter.
“I was maybe a little bit surprised. It's nice for me to beat her for once because she has been beating me so many times.”
Frida Hansdotter after winning the women's slalom. Photo: AP Photo/Morry Gash
Hansdotter added: “I felt at the start of both runs today that it was so fun. I had a smile on my face and tried to ski as fast as I could.”
“I love skiing and I love racing. To be able to ski at this level is so much fun and now I bring home a gold medal. It is a lot of hard work and a lot of years but it is worth every minute when I am standing here.”
Holdener said she felt the pressure being the last of the top 30 racers to come down the second leg.
“I knew what could happen but I also knew what cuold go wrong. If you are the last one on the start and you know you can win or get a medal, it's not that easy to bring it home,” the Swiss said.
“I didn't ski as good as I could in the second run. My legs weren't that fast.”
Article by AFP's Luke Phillips