President Barack Obama has launched an astonishing attack on Ireland’s tax loopholes and all but accused US businesses who use them of tax treason.

In his hardest hitting speech yet on the practice whereby American companies base their operations in Ireland to gain tax advantages, the President has castigated major corporations who do it.

President Obama said: “What we are trying to do is to say that if you simply acquire a small company in Ireland or some other country to take advantage of the low tax rate [and] you start saying, ‘we are now magically an Irish company,’ despite the fact that you might have only 100 employees there and you have got 10,000 employees in the United States, you are just gaming the system.

“You are an American company.”

Speaking at a Los Angeles college, the President added that these companies were technically renouncing their US citizenship, even though most of their operations were in the US.

He said: “I don’t care if it’s legal - it’s wrong. You don’t get to choose the tax rate you pay. These companies shouldn’t either.

“Some have called these firms ‘corporate deserters.’ You shouldn’t get to call yourself an American company only when you want a handout from American taxpayers.”

He accused them of ‘gaming the system’ by relocating their headquarters to countries such as Ireland where corporate tax rates are lower to avoid taxes in the US, according to a report in the Irish Times.

He attacked the practice known as ‘inversions’ which more and more US companies have recently used to reduce their taxes.

The President said that US corporations are exploiting an ‘unpatriotic tax loophole’ when they move their head offices overseas in takeovers of smaller foreign companies.

He named Ireland as a location that US companies are using to take advantage of ‘technically legal’ tax arrangements, according to the report.

The Irish Times report adds that Ireland is one of the most popular countries for US companies seeking foreign acquisitions in recent years.

Ireland’s corporation tax rate of 12.5 per cent is about a third of the US rate of 35 per cent, one of the highest in the developed world.

The paper adds that Republicans and Democrats are divided over how to stop the practice.

It says the White House has supported Democratic efforts in Congress to pass a law curbing inversions but Republicans prefer changes as part of a broader reform of the US tax system that would lower the corporation tax rate to make it more competitive.