At least 24 people have died in a fire at a drug rehabilitation clinic in Azerbaijan's capital, Baku, according to the General Prosecutor's office and the ministry of emergency.

The Prosecutor's office and the police said in a joint statement on Friday that at least 31 people were rescued, while three people were admitted to hospital.

The fire broke out at the the Republican Narcology Dispensary - a one-storey wooden structure - at 06:10am local time (02:10am GMT), the statement said.

Preliminary investigations blamed short circuit in the building's electrical network for the deadly blaze that was put out at 08.30 (04:00am GMT) local time.

Criminal cases have been initiated against some construction companies for labour law violations, state news agency, APA said.

Azerbaijan's President Ilham Aliyev, who visited the scene, has instituted a commission to be headed by Prime Minister Abid Sharifov to investigate one of the deadliest fire tragedies in the country.