NATO ally Turkey lifted its veto over Finland and Sweden's bid to join the Western alliance on Tuesday after the three nations agreed to protect each other's security, ending a weekslong drama that tested allied unity against Russia's invasion of Ukraine.

The breakthrough came after four hours of talks just before a NATO summit began in Madrid, averting an embarrassing impasse at the gathering of 30 leaders that aims to show resolve against Russia, now seen by the U.S.-led alliance as a direct security threat rather than a possible adversary.

It means Helsinki and Stockholm can proceed with their application to join the nuclear-armed alliance, cementing what is set to be the biggest shift in European security in decades, as the two, long-neutral Nordic countries seek NATO protection.