"This is truly an historic moment," NATO Secretary-General Jens Stoltenberg said alongside the foreign ministers of the two countries. "With 32 nations around the table, we will be even stronger."
The signing at NATO headquarters follows a deal with Turkey at last week's NATO summit in Madrid, where Ankara lifted its veto on the Nordic membership bids following assurances that both countries would do more to fight terrorism.
Stoltenberg urged allies to swiftly ratify and assured the two Nordic countries of NATO's support in the meantime.
"The security of Finland and Sweden is important for our alliance, including during the ratification process," he said.
"Many allies have already made clear commitments to Finland's and Sweden's security, and NATO has increased our presence in the region, including with more exercises."
The protocol means Helsinki and Stockholm can participate in NATO meetings and have greater access to intelligence but will not be protected by the NATO defense clause - that an attack on one ally is an attack against all - until ratification. That is likely to take up to a year.
After weeks of diplomacy, Erdogan and his Finnish and Swedish counterparts agreed measures to allow the two Nordic countries to overcome a Turkish veto that Ankara imposed in May due to its concerns about terrorism.
According to a signed memorandum, Finland and Sweden pledged not to support the Kurdish militant PKK and YPG groups or the network of U.S.-based cleric Fethullah Gulen, which Ankara labels a terrorist organisation.
It was at an allied summit in Madrid in 1997 that Hungary, Poland and the Czech Republic were invited to join, in the first of several waves of NATO's eastern expansion - seen as an achievement for the West but which has angered Russia.
Moscow has repeatedly warned both countries against joining NATO. On March 12, the Russian foreign ministry said "there will be serious military and political consequences".