Students sharing a flat were at risk of carbon monoxide poisoning because their GP landlord failed to maintain the boiler.
The danger was spotted when a gas engineer was called to repair a fault in the boiler at the flat in Oxford.
The engineer refused to carry out the repairs and called another engineer who condemned the boiler and flue.
An investigation revealed Dr Mahmood, of Glasgow, had not carried out annual safety checks required by law for two years.
Oxford Magistrates Court heard that this exposed the tenants to a risk of carbon monoxide poisoning.
Mahmood admitted breaking three gas safety regulations. He was given a two-year conditional discharge and ordered to pay £4,928 costs
After the hearing, HSE's Inspector Dozie Azubike said: "Dr
Mahmood's lack of care could have had serious consequences for his student tenants. Every year approximately 20 people die and many others suffer ill health from carbon monoxide poisoning.
"Unchecked gas appliances can become unsafe over time, exposing tenants to possible serious injuries or even fatality. It is therefore vitally important that landlords fulfil their gas safety obligations to their tenants."
Paul Johnston, chief executive of Gas Safe Register, explained landlords have a legal duty to ensure gas appliances in any property they rent are safety checked by a qualified engineer once a year and that they provide a copy of the gas safety record to their tenants.
"Tenants should also be aware that it is their right to ask to see a copy of the gas safety record if one has not already been provided,” he said.