Vlhova, 23, finished second behind Viktoria Rebensburg in the first run but she flew down the slope in her second go, clocking a time of 1:00.87.
Her run came after Shiffrin and it looked as if the American had done everything she needed as she overtook Federic Brignone.
However Vlhova beat her great rival and then nervously watched on as Rebensburg rode out as the last rider.
Vlhova secures gold with fabulous second run
It looked the entire way down as if Rebensburg had beaten Vlhova but she lost it right at the end and had to settle for silver in the end.
Rebensburg has to settle for silver after narrowly missing Vlhova's time
It was a sweet moment for Vlhova, who has regularly had to watch Shiffrin take victory in this World Cup season and she is the first Slovakian to win gold at the World Championships.
Petra Vlhova of Slovakia in action during the FIS World Ski Championships Women's Giant Slalom on February 14, 2019 in Are Sweden
Image credit: Getty Images
New Zealand’s Alice Robinson was first out of the gate in the second run and she set the early pace, with the riders who followed her struggling to get a grip with the snow as no-one could match her time.
Clara Direz of France was the first to tackle Robinson’s overall time but still riders were finding the going tough with the surface smoother compared to the opening run and the wind really picking up.
As the top half of the start list took to the snow home favourite Sara Hector set the new pace as she put down a time of 1:00.94 in her second run but fellow Swede Frida Hansdotter couldn’t match that speed.
As the top riders began their runs Hector’s time came under threat with Italy’s Brignone clocking a time of 1:00.98 to move temporarily into the lead before the final five came out.
There was worse news for compatriot and 2017 bronze medallist Sofia Goggia as she crashed out.