Nielsen was the narrow winner of the annual pop festival to select Sweden's Eurovision entry with her song Undo. The 29-year-old defeated Ace Wilder by just two points after the results from the Swedish public were counted.
"It feels really fantastic, I'm thrilled," a jubilant Nielsen told Eurovision.tv following her win.
The singer, who made her Melodifestivalen debut in 2001, looked set for more heartbreak after Ace Wilder moved into first place following the votes of the international juries.
When the votes from the Swedish viewers were voted she went one better than 2008, when she finished second, to represent her country at the Eurovision Song Contest in May.
"It was lovely votes from the jury so I was very pleased and I felt a little bit relaxed actually. After the jury had voted I thought to myself now I can totally relax and just enjoy the evening whatever the result is from the people. And then they really voted fantastic," beamed Nielsen to reporters in Stockholm after her win.
Runner-up Ace Wilder wasn't too despondent with the result and told the media she wished Nielsen well at the Eurovision.
"I hope she kicks ass in Denmark which I know she will," said the Busy Doin' Nothin' singer.
Nielsen (212 points) and Wilder (210 points) finished well clear of third placed Alcazar who racked up 110 points with the track Blame it on the Disco.
The winner said she is excited ahead of May's Eurovision Song Contest which takes place between May 6th and May 10th.
"I love Eurovision and I'm so looking forward to it," she said.
Sweden has won the Eurovision Song Contest on five occasions. Abba triumphed forty years ago with Waterloo while Loreen won in 2012.
The 2013 Eurovision Song Contest was held in Malmö while the 2014 edition is being hosted just across the Öresund Bridge in Copenhagen.