The Swedish parliament ratified the so-called Host Nation Support Agreement (HNSA) late in the afternoon. A Left Party proposal to stay proceedings was voted down by 291 votes to 21.
Protests were heard from the public galleries when the decision was made, prompting the speaker of the house to call in security guards. Police later arrived to escort seven women making loud crying sounds from the building.
The Left Party, arguing that the much-debated deal posed a risk to the rights and freedoms in Sweden's constitution, had originally been backed by the far right Sweden Democrats in an unlikely alliance between the two politically enemies.
However, the latter pulled its support at the eleventh hour.
"There is a very broad majority for the host nation agreement in parliament. The Left Party and us make up about 20 percent of the members of the chamber," its leader Jimmie Åkesson told Aftonbladet a day ahead of the vote.
"We would probably have been able to push it back a few weeks, but a stay of proceedings would not have gone through."
The Left Party's leader, Jonas Sjöstedt, criticized the party's U-turn.
"I am not at all surprised. The Sweden Democrats have been very wobbly on issues to do with freedom from alliances for some time now," he told the TT news agency.
Originally signed in September 2014, the HNSA with Nato would allow the alliance to transport helicopters, aircraft and ships across Swedish territory, but only upon Sweden's invitation.
As the agreement involves changes to Swedish law in order to give Nato personnel privileges and immunities with regards to areas like tax and custom rules, it required parliamentary ratification. After the stamp of approval it is expected to come into force on July 1st, 2016.
Public opinion in traditionally non-aligned Sweden has shifted towards Nato in recent years.
A Sifo poll released in September 2015 showed a marked change, with more Swedes in favour of joining the military alliance than against.
Of the 1,000 respondents, a total of 41 percent told the poll they were in favour of seeking membership in the military defence alliance, 39 percent said they were against it and 20 percent were uncertain.