The measure had been deadlocked for months because of a split between the European Parliament and EU states, which have joint say.
The countries that were against a CDS ban agreed to it after the parliament said they could opt out if the curb was damaging their government debt market.
“It is a very ambitious accord which strengthens financial stability and strengthens the single market for financial services,” Michel Barnier, the EU’s financial services chief, said.
The law, which also includes reporting requirements on shortselling shares, will take effect from 1 November 2012 on new contracts.
Andrew Baker, chief executive of the Alternative Investment Management Association, said the ban could increase pressure on already stretched lending markets.
“It could not only reduce liquidity and increase volatility in debt markets, but also increase government borrowing costs and reduce real economy investments in EU member states,”he said.