* Ruling Social Democrats opt for Sweden joining NATO
* Decision overturns decades of security policy
* Nations set to ignore Moscow's warnings of 'retaliatory steps'
* War in Ukraine triggers the NATO expansion it sought to avoid (Adds context and quotes)
By Niklas Pollard and Simon Johnson
STOCKHOLM, May 15 (Reuters) - Swedish Prime Minister Magdalena Andersson will seek broad support for an application to join NATO on Monday, she announced on Sunday after her party dropped its long-standing opposition to membership in the wake of Russia's invasion of Ukraine.
Joining NATO was a distant prospect just months ago, but Russia's attack on its neighbour has prompted both Sweden and Finland to rethink their security needs and seek safety in the military alliance they stood apart from during the Cold War.
The war in Ukraine, which Moscow calls a special military operation but which has already killed thousands and displaced millions, shattered long-standing security policies and fuelled a wave of public support for NATO membership in both countries.
Following internal debates over the past week among the leadership of the Social Democrats, the biggest party in every election for the past century, Andersson said NATO entry was "the best thing for the security of Sweden and the Swedish people".
"Non-alignment has served us well, but our conclusion is that it will not serve us as well in the future," she said.
Supporters of joining the alliance will now command a broad majority in Sweden's Riksdag with much of the opposition already in favour, and a formal application by Andersson's minority government will follow.
In Finland, President Sauli Niinisto confirmed the country's intentions to apply on Sunday, saying the region would benefit.
"We get security and we also extend it through the Baltic sea region and the entire alliance," he told reporters gathered in the presidential palace in Helsinki.
At peace since the days of the Napoleonic wars, Sweden has been more reluctant to cast aside its non-alignment than Finland, which fought the Soviet Union in the 20th century.
Popular support for entry jumped to more than 60% in Sweden from about 40% before the war.
"I didn't think it was necessary before but now it feels better to have countries that would come to our defence," said pastry shop worker Cecilia Wikstrom, 32.
TENSE WAIT
A membership application will herald a tense wait during the months it takes to be ratified by all NATO members - Turkey has already voiced its objections, though the alliance and the White House have said they were confident any security concerns could be addressed in the interim.