The proposal, under the name 'Deal on political dialogue and collaboration between the European Union and its member states, on one side, and the Cuban Republic on the other', was first put to the Swedish parliament in 2018, but from the beginning has divided the country's eight political parties.
The position of the EU, and Sweden's Social Democrat-Green government, was that further isolation will not encourage Cuba to improve on human rights, and that a common EU position on trade and political dialogue would instead be the best way to achieve that.
But civil rights groups, including Sweden's Civil Rights Defenders, campaigned against the proposal, arguing that the EU should instead send a signal that it does not support Cuba's one-party system.
Sweden was long one of the few countries in the EU that had not ratified the deal.
Four opposition parties voted against the proposal in parliament on Wednesday, including the Centre Party, Liberals, Sweden Democrats and Christian Democrats. But with the support from the Left Party and the conservative Moderates, the government's proposal to ratify the agreement was approved.
Negotiations on the EU-Cuba deal began in 2014 and it was provisionally applied in November 2017 following European Parliament approval in July that year.
However, it requires ratification from all 28 of the EU's member states before it can be fully implemented, and this is often a long process. In Sweden, international agreements of this kind require the approval of parliament.
A provisional version of the agreement has begun to be implemented, but if the EU's member states do not all ratify the deal, it will not continue to be valid.
Cuba is the only country in Latin America that the EU does not already have some kind of agreement with, and the new deal comprised of three sections (one on political dialogue, one on cooperation and sector policy dialogue, and one on trade and trade cooperation) is seen as a European response to Donald Trump's isolationist approach to the island.