And bosses have been forced to write off thousands of pounds of debt which they have been unable to claim back.

Britain has healthcare agreements with some countries and provides free NHS care for those living in Britain regardless of nationality, but most other foreign visitors have to pay for non-emergency treatment.

But hospitals say there are often complications when trying to claim back the money and the decision to write off debt is always a last resort.

Wolverhampton's hospital trust has been left with the highest amount of debt between 2007 and 2012. Health chiefs were owed £757,919.98 from patients from overseas and have had to write off £174,428.95. They are currently owed £486,894.51 but say £113,249.80 of this is covered by insurance.

Mid-Staffordshire NHS Trust, which recently announced it was heading for administration, is owed £6,283.84 from the 2012/13 year so far but nothing has been written off. A total debt of £24,568.23 has been racked up by patients from outside the EU since the 2009/10 financial year.

Sandwell and West Birmingham Hospitals NHS Trust is owed £347,940 by patients from outside the EU and has written off £232,185 in the past five years. People who were treated in Dudley have clocked up £52,293 of debt in the past five years.

The Dudley Group NHS Foundation Trust has written off £58,535 owed by overseas patients during this time, some of which would have been accumulated before 2007.

Stourbridge MP Margot James today said: "Hospitals should carry out checks on people's immigration status if there is any doubt about their eligibility for treatment and, unless it is a medical emergency or a need for maternity or antenatal care, healthcare treatment should be refused."

Russells Hall Hospital and its foreign patients policy hit the headlines in October 2011 when an illegal immigrant from Pakistan was deported after more than a year at the hospital. His care had cost the hospital more than £100,000.

Walsall Healthcare NHS Trust was owed £71,818.75 by patients outside the European Union during the period and has written off £48,538 of debt in the past five years.