Worthing Borough Council found five people living in dangerous conditions in the property.
The flat in Heene Road, Worthing, did not have suitable fire detection, and fire doors to individual rooms had not been installed.
There was also no safe fire escape route and the condition of the stairs meant that access was hazardous.
As required by law, the landlord had also failed to get a licence for the three-storey building and House in Multiple Occupation (HMO).
The lack of suitable fire separation between a commercial kitchen on the ground floor and the residential flats meant the Council had to serve an Emergency Prohibition Order, making five people homeless.
Officers from the Council’s Private Sector Housing team and West Sussex Fire & Rescue Service inspected the flat above a kebab shop in December last year.
The owner of the flat, Yilmaz Yaziciglou of South Farm Road, Worthing, was charged with failing to licence an HMO and eight further charges under the HMO management regulations.
Mr Yaziciglou who pleaded guilty was fined £4,000 for failing to licence an HMO, an additional £1,500 for each of the eight offences under the management regulations, and was also ordered to pay £6,224.76 in legal costs and £170 victim surcharge for a total of £22,394.76.
Cllr Heather Mercer, Worthing Borough Council’s Executive Member for Customer Services, said: “The landlord of this flat showed complete disregard for the safety and wellbeing of his tenants and it is only through the timely intervention of the council’s private sector housing team that serious injuries or worse were prevented.
“The level of the fine shows that the court recognises the gravity of the conditions within this flat and completely justifies the actions taken by Worthing Borough Council.’
“Owners of HMOs need to be aware that if they do not comply with the new requirements the Council will take action to protect residents.”
At the time of this offence, only properties with three or more storeys rented out to five or more people forming two or more households sharing facilities needed a licence.
As of 1 October 2018, any property with five or more people forming two or more households sharing facilities will need to be licenced.
Failing to licence an HMO can result in an unlimited fine, or a civil penalty notice of up to £30,000.