WASHINGTON — Ukraine is on an “irreversible” path to NATO membership, the military alliance said Wednesday in a final agreement from its summit, advancing assurances that Ukraine will be allowed to join the Western coalition but only after its war with Russia ends.

In another boost for Ukraine, the U.S., the Netherlands and Denmark announced Wednesday that the first NATO-provided F-16s were on their way to Ukraine and would be flying this summer following months of work.

Ukrainian President Volodymyr Zelenskyy tweeted his appreciation on the effort to strengthen his air force, coming soon after Ukraine saw one of the deadliest strikes of the war.

“Ukraine’s future is in NATO,” according to the communique from NATO’s 32 members, whose leaders are meeting in Washington this week. “We will continue to support it on its irreversible path to full Euro-Atlantic integration, including NATO membership.”

The alliance welcomed Ukraine’s democratic, economic and security reforms needed to join and said it would get an invitation “when Allies agree and conditions are met.”

Earlier, NATO Secretary-General Jens Stoltenberg underlined that Ukraine will not join the alliance’s ranks immediately. But he insisted that must happen after the war is over to ensure that Russia never attacks Ukraine again.

Zelenskyy, in Washington for the NATO summit, has battled for at least a firm guarantee from NATO that Ukraine can join the military alliance. He has feared his country would otherwise be left to fight a stronger Russia indefinitely.

The U.S. and some other countries have opposed membership for Ukraine during the conflict with Russia to avoid an escalation of tensions. They also have stressed that Ukraine must take steps to address corruption and as well as other systemic reforms.

Russian President Vladimir Putin has opposed neighboring Ukraine’s fight to join the Western alliance, declaring it an encroachment on Russia’s security and interests.

President Joe Biden, who later appeared on stage with Stoltenberg, reaffirmed U.S. support for Ukraine but also more broadly the importance of NATO. He reiterated that since he took office, the number of allies spending at least 2% of their gross domestic product on defense has increased from nine to 23 and that the number of battle groups has doubled on NATO’s eastern flank.

“We can and will defend every inch of NATO territory, and we will do it together,” Biden said.