By Nick Triggle
BBC News health reporter
Louise McMenemy has found funding her studies tough
Medical students are finishing their five-year courses with crippling levels of debt, the doctors' union says.
A British Medical Association poll of more than 2,000 students found those now starting their studies face debts at graduation of nearly £40,000.
Doctors warned a career in medicine was in danger of becoming a viable option only for the wealthy.
But the government said support was available for students from the poorest backgrounds.
The survey of students in England and Northern Ireland, where tuition fees apply, found those who started before the introduction of the charges in 2006 were graduating with debts of £19,000.
But it revealed the intake since then were likely to face paying back £37,000 on average.
Tim Crocker-Buque, chairman of the BMA's medical students committee, said: "Medical education is becoming increasingly expensive, edging ever close to the total exclusion of those without the access to the cash with which to fund themselves.
"Medical education should be about your potential to become a great doctor , not you ability to pay."
He also warned the government not to raise the £3,225 yearly cap on tuition fees, saying it could have a "crushing" effect on students.
A review into the fees will be carried out later this year with some predicting universities will be allowed to set their own charges potentially leading to prices of up to £20,000 a year.
Mr Crocker-Buque said: "The fees being talked about will place a devastating financial dilemma in front of families of all social backgrounds."
As well as calling for the cap on fees to be retained, the BMA said the government should also help charities to support young people from low income families to pursue medical careers.
Just one in 10 students are from the lowest social groups and the union believes this could drop further in the future.
Louise McMenemy, who is studying at King's College London, said being a medical student in the 21st century was a daunting experience.
Despite the prospect of a well paid job, Ms McMenemy said: "I am nearly £40,000 in debt and that is likely to rise to £50,000 by the time I graduate.
"That will take me 20 years to pay off. I really don't like to think about it."
The 23-year-old from Southampton, who comes from a single parent family, said: "The problem when you are studying medicine is that you do not get a chance to work like other students.
"Certainly in the later years, getting a part-time job is almost impossible as you spend so much time in hospital and you don't get much holiday.
"I worked in the evenings and weekends in my first two years, but not since."
But the government said the system was fair as it had been structured to help those who were least able to pay.
The government said families earning less than £25,000 a year were eligible for a grant to cover the cost of the fees which tapered to nothing for families on incomes of £50,000.
A spokesman for the Department of Business, Innovation and Skills said: "This government is determined that finance is not a barrier to accessing higher education.
"More people than ever are applying to university in England and we are committed to ensuring that those who want to succeed are supported by a generous package of loans and bursaries."