An illegal immigrant used false passports and references to get a hospital job in Bradford, a court heard.
David Oyeniyi, 35, was paid almost £60,000 over four years, working as a cleaning services assistant, Bradford Crown Court was told.
Nigerian-born Oyeniyi used a false Dutch passport and references in his job application.
But the court heard he had worked hard and there had been no complaints from the Trust.
Judge Peter Benson said it was an unfortunate case where the defendant had got work under false pretences but had worked very hard.
The judge told Oyeniyi: “It is apparent that you are a hardworking, God-fearing family man.
“There is absolutely no criticism of the standard of your work.”
Oyeniyi, of Eskdale Rise, Allerton, Bradford, pleaded guilty to fraud by false representation.
Prosecutor Abdul Shakoor said the defendant applied for the cleaning job with the Bradford Teaching Hospitals NHS Foundation Trust in 2008, using a false Dutch passport and false references.
He got the job and started work in January 2009, working there until leaving the job suddenly at the end of October 2013 when he became aware he was being investigated.
The court heard the defendant had come to the UK from Nigeria in 2001 and originally lived in London and worked as a barber, before becoming friends with a Bradford man who arranged for the copy of the false passport.
Oyeniyi signed the job application containing the false information.
Mr Shakoor said an application by Oyeniyi for indefinite leave to stay in the country had been refused three times.
He said if the Trust had been aware of the defendant’s true circumstances he would not have been employed.
In mitigation, Oyeniyi’s solicitor advocate, Tom Rushbrooke, said his client was now doing the same job at Bradford Royal Infirmary and had increased his hours. He had pleaded guilty at the first opportunity.
Oyeniyi was sentenced to six months imprisonment suspended for two years, with 120 hours unpaid community work and was ordered to pay £400 costs.