Finland's Käärijä, a green-bolero-sleeved rapper, came second. He won the viewer vote, but it was not enough to overtake Loreen's lead after the result from the juries in the 37 participating countries.
Loreen is the only person after Ireland's Johnny Logan to win the contest twice, and her victory puts Sweden level with Ireland as the most successful Eurovision country.
The 67th edition of the musical festival was held in the "City of Pop" on behalf of Ukraine, last year's winner, which was unable to host this year because of Russia's invasion.
Organisers had to walk a tightrope between putting Ukraine centre stage and steering clear of any overtly political messages, which are not allowed in the contest.
They largely succeeded.
Kalush Orchestra, 2022's winner, mixed video recorded in Ukraine with a live performance in Liverpool in an opening sequence that included a pre-recorded cameo appearance from Britain's Kate, Princess of Wales, playing the piano.
But as the contest was underway, Russian missiles hit the western Ukrainian city of Ternopil, which is home to the electro-pop duo Tvorchi, this year's contestants from Ukraine.
Local authorities, writing on Telegram, said the strike had injured two people.
Ukrainian President Volodymyr Zelenskiy was barred from addressing worldwide viewers - who numbered 160 million last year - by contest organiser the European Broadcasting Union.
It said that granting his request, which was made with "laudable intentions", would be against the non-political nature of the event and its rules prohibiting making political statements.
Reuters