After a blank opening end Sweden went two up before Scotland were able to claw back following a mistake.
Scotland rallied late on and went into the final end 4-3 in front although Sweden did have the hammer.
In the end it all came down to the final throw, with Hasselborg producing a perfectly pinpoint effort to secure two points and the gold.
'It makes me want to cry' - Hasselborg emotional after Sweden gold
“We knew as long as we had the hammer in the tenth we have a good chance and we got the hammer in the tenth and that was exciting,” Hasselborg said.
“I threw the same in the sixth so I knew I had a pretty good idea of what the ice would do there. And Sara made me take a little bit less ice and it was perfect, she skipped it perfectly.”
The result means Sweden won double gold after Niklas Edin’s team took gold in the men’s final earlier in the day.
“We always though it was a spell on us as we couldn’t win the same two championships but apparently we only needed Maria [Prytz] as a national coach so the spell is broke and I’m so happy,” Hasselborg said.
'Magnificent' - Watch Sweden clinch gold in style against Scotland
Like Edin earlier in the day, Hasselborg was quick to pay tribute to the home fans who maintained a terrific atmosphere.
“It’s been a dream it makes me almost want to cry. The audience, the fans were amazing today, they carried us through all ten ends, oh my god what a game.
“Eve and her girls played so well, we have so much respect for this team and it was a great game.”
For Muirhead it’s her fifth silver medal but she was keen to stress how proud she was of the effort put in.
“Tough to take but give Anna her dues what a fantastic shot to win the championships," Muirhead said.
“We put up a good fight, it was a very good game, it’s disappointing but to get a silver medal when it was Vicky’s first championships.
“It was difficult but we put up a real fight.”