Sweden was represented at the Eurovision Song Contest 2012 with the song "Euphoria", written by and Peter Boström, and performed by Loreen. The Swedish participating broadcaster, (SVT), organised the national final Melodifestivalen 2012 in order to select its entry for the contest. After a six-week-long competition consisting of four heats, a Second Chance round and a final, "Euphoria" performed by Loreen emerged as the winner after achieving the highest score following the combination of votes from eleven international jury groups and a public vote.
Sweden was drawn to compete in the second semi-final of the Eurovision Song Contest which took place on 24 May 2012. Performing during the show in position 11, "Euphoria" was announced among the top 10 entries of the second semi-final and therefore qualified to compete in the final on 26 May. It was later revealed that Sweden placed first out of the 18 participating countries in the semi-final with 181 points. In the final, Sweden performed in position 17 and placed first out of the 26 participating countries, winning the contest with 372 points. This was Sweden's fifth win in the Eurovision Song Contest, having previously won in , , , and .
Prior to the 2012 contest, (SR) until 1979, and (SVT) since 1980, had participated in the Eurovision Song Contest representing Sweden fifty-one times since SR's first entry . They had won the contest on four occasions: in with the song "Waterloo" performed by ABBA, in with the song "Diggi-Loo Diggi-Ley" performed by Herreys, in with the song "" performed by Carola, and in with the song "Take Me to Your Heaven" performed by Charlotte Nilsson. Following the introduction of semi-finals for the , Swedish entries, to this point, have featured in every final except for when it failed to qualify. In , "Popular" performed by Eric Saade placed third.
As part of its duties as participating broadcaster, SVT organises the selection of its entry in the Eurovision Song Contest and broadcasts the event in the country. Since 1959, SR first and SVT later have organised the annual competition in order to select their entries for the contest.
Melodifestivalen 2012 was the Swedish music competition organised by SVT to select its entry for the Eurovision Song Contest 2012. 32 songs competed in a six-week-long process which consisted of four heats on 4, 11, 18 and 25 February 2012, a second chance round on 3 March 2012, and a final on 10 March 2012. The six shows were hosted by Sarah Dawn Finer, Gina Dirawi, and Helena Bergström. Eight songs competed in each heatâÂÂthe top two qualified directly to the final, while the third and fourth placed songs qualified to the second chance round. The bottom four songs in each heat were eliminated from the competition. An additional two songs qualified to the final from the second chance round. The results in the heats and second chance round were determined exclusively by public televoting, while the overall winner of the competition was selected in the final through the combination of a public vote and the votes from eleven international jury groups. Among the competing artists were former Eurovision Song Contest contestants Lotta Engberg (participating as a duet with Christer Sjögren) who represented , Charlotte Perrelli who represented (which she won) and , Afro-Dite who represented , and Andreas Lundstedt who represented . Molly Sandén represented .
The final was held on 10 March 2012 at the Globe Arena in Stockholm. Ten songs competedâÂÂtwo qualifiers from each of the four preceding heats and two qualifiers from the Second Chance round. The combination of points from a viewer vote and eleven international jury groups determined the winner. The viewers and the juries each had a total of 473 points to award. The nations that comprised the international jury were Belgium, Bosnia and Herzegovina, Cyprus, Estonia, France, Germany, Ireland, Malta, Norway, Ukraine and the United Kingdom. "Euphoria" performed by Loreen was selected as the winner with 268 points.
Sweden competed in the second half of the second semi-final in Baku on 24 May 2012, following and preceding . Loreen received 181 points and placed 1st, thus qualifying for the final on 26 May. The public awarded Sweden 1st place with 180 points and the jury awarded 1st place with 148 points.
In the final, Sweden was drawn to have performed 17th, after and preceding . The Swedish entry received votes from 40 countries and won the contest, with only failing to award them any points. Loreen scored a total of 372 points, the second-highest winning score in the contest's history after 's 387 point win in . Sweden received a record set of 12 points from 18 countries. The public awarded Sweden 1st place with 343 points and the jury awarded 1st place with 296 points. This was the fifth win for Sweden at the Contest.
The Swedish entry was awarded two of the three Marcel Bezençon Awards, which honour the best of the competing entries for the 2012 contest in different areas of achievement. The Artistic Award was presented to the best artist as voted by the commentators and the Composer Award was the best and most original composition as voted on by the participating composers. Loreen's performance in the contest was directed by Swedish choreographer Ambra Succi.