REYKJAVIK (Reuters) - Iceland’s center-right Independence, Reform and Bright Future parties have agreed to form a coalition government and will give parliament a vote on whether to hold a referendum on joining the European Union.

Together, the coalition will hold 32 of the 63 seats in parliament. The Independence Party will have 21 seats, making it the largest party in the coalition. However, it opposes EU membership while the other two parties both favor it.

The Independence and Reform parties accepted the agreement on Monday, Icelandic media reported. Bright Future said it had backed the deal in a vote overnight. The agreement ends a political impasse since a general election in October.

“The agreement was, after a discussion, voted on by the management by electronic voting and was accepted by the party,” Bright Future spokesman Unsteinn Johannsson said.

In November, the three parties abandoned an attempt to form a coalition. The Left Greens and the Pirate Party also made unsuccessful attempts to form a government before the mandate was returned to the Independence Party.

Iceland applied to join the EU in 2009, a year after a banking crash left the country on the verge of bankruptcy. The crash led many to argue it should have closer ties with Europe and even join the single currency to shield it from future crises.

Iceland, already a member of the European Free Trade Association (EFTA), later shelved the talks.