American companies that merged with foreign companies to avoid taxes paid $45 million less in taxes on average in the first year after the move, according to a new analysis by the Congressional Budget Office.

If current policy does not change, the agency projects future tax-avoiding deals will reduce tax receipts from corporations by 2.5 percent in 2027 — or $12 billion.

The idea behind the business maneuver, called a corporate inversion, is simple: a U.S. company merges with a foreign one and moves its headquarters abroad, avoiding the high U.S. corporate tax rate of 35 percent on foreign income.

That effectively turns the U.S. corporation into a foreign company, taxed at the rate of its new home country.

According to the CBO analysis, companies that inverted between 1994 and 2014 experienced, on average, a $65 million drop in U.S. taxes in the financial year after the deal was complete. Their tax bills only dropped by $45 million, however, because they were paying more foreign taxes.

The first inversion occurred in 1983, according to CBO, but the deals have become notorious in recent years, with critics calling them a sign of the broken U.S. corporate tax code.

Politicians on both side of the aisle agree that inversions are a problem; on the campaign trail, President Trump criticized a proposed deal that would have allowed pharmaceutical giant Pfizer to leave the country to avoid taxes and President Obama called inversions one of the most “insidious tax loopholes out there.” But the sides have not agreed on how to address the problem, with Democrats introducing legislation to stop inversions and Republicans calling for comprehensive tax reform.

The practice has drawn more political scrutiny in recent years, due to an increase in the scale of the mergers being considered.

In the first nine months of 2014, 10 companies — with total assets of $300 billion — proposed inversions. Then, the Obama administration tightened the rules around such deals, making them less advantageous. Some of the biggest proposed mergers collapsed.

CBO is optimistic that the trend is slowing. Companies seeking to dodge taxes by inverting will have more trouble going forward, the agency said. That's because the benefits will not always outweigh the costs, regulations could make it harder to pursue the strategy, or for practical reasons — there simply may not be a foreign company to merge with in a low-tax country.