Image copyright AP

US President Barack Obama has urged lawmakers to end a tax loophole that allows US companies to avoid paying US corporate taxes.

He accused firms of "cherry picking" the rules, by moving their tax base overseas, while keeping most of their business in the US.

Know as inversion, nine companies so far this year have used the practice.

"My attitude is I don't care if it's legal - it's wrong," the president said in a speech in Los Angeles.

The potential savings of inversion were widely seen as part of the reason why US pharmaceuticals firm Pfizer attempted to buy Britain's AstraZeneca earlier this year.

That deal stirred up controversy with critics concerned that the company would cut back on UK research and development.

'Stop rewarding'

President Obama also called for "economic patriotism".

"Economic patriotism says it's a good thing when we close wasteful tax loopholes and invest in education, and invest in job training that helps the economy for everybody.

"Let's stop rewarding companies that ship jobs overseas; give tax breaks to companies that are bringing jobs back to the United States," he said.

Democrats in the US Congress have put forward a proposal that would make inversion much more difficult and the president called on Republicans to support that effort.

US companies have called on the government to lower and reform corporate taxes, which would make it less attractive for them to move their tax base overseas.