House Speaker John Boehner (R-Ohio) and House Ways and Means Committee Chairman Dave Camp (R-Mich.) personally profited from a corporate tax loophole that they have opposed closing, according to Bloomberg.

Boehner and Camp announced that they were selling their stock in Dublin-based Covidien shortly after the American medical technology company Medtronic agreed to acquire it. The merger would allow Medtronic to move its formal headquarters overseas to reduce its tax bill.

According to Bloomberg, Covidien’s stock price shot up after the acquisition was announced, and both Boehner and Camp sold between $15,000 and $50,000 shares of their stock in the company.

The transactions were legal and publicly disclosed, and both lawmakers denied that there was any conflict of interest between their personal finances and public policy positions.

“Speaker Boehner is not involved in day-to-day stock trades,” Michael Steel, a Boehner spokesman, told Bloomberg. “He delegated that authority to an investment adviser, who has handled such transactions for years.”

Camp, who chairs the House committee responsible for making tax policy, also said in a statement to Bloomberg that a firm handled his investments and that he was not involved in the deal.

So-called inversion deals pose two problems for the U.S. Treasury. The American government taxes earnings from foreign profits for companies headquartered in the U.S., but only taxes the money once it is brought back into the U.S. With an offshore headquarters, companies can dodge American taxes on these funds, instead paying at a lower foreign rate. The offshore headquarters also presents companies with the ability to load up the American subsidiary with debt, effectively shifting its domestic profits abroad and preventing them from being taxed here.

The U.S. corporate tax code has a higher top rate than other developed countries, but it also features thousands of generous loopholes and perks that result in a substantially lower effective rate for most companies than the official number.

President Barack Obama has called inversions “unpatriotic” and said he would unilaterally act to close the loopholes. Senate Democrats have also outlined a proposal that would limit inversions.

In an op-ed for Politico, Boehner said that Obama shouldn’t attempt to curtail inversions without legislation from Congress and that fixes to inversions needed to be part of a broader tax reform effort. Camp -- who is retiring from Congress this year -- has introduced legislation that would lower the corporate tax rate and close corporate tax loopholes. House GOP leadership has not brought the bill up for a floor vote.