The first victim was a male employee at the ministry who died from smoke inhalation and burns while on the fifth floor of the building, according to emergency services spokesman Carlos Fuentes.
A female union worker has also died.
The fire is believed to have started on the fifth floor of the nine-storey building.
Around 50 people were evacuated from the building and 25 were taken to hospital with smoke inhalation or burn injuries, Mr Fuentes added.
Three of the injured are in a serious condition.
Mr Fuentes said that some people were injured after jumping from the building.
The blaze has now been extinguished and nobody is trapped inside.
Salvador Sanchez Ceren, El Salvador’s President, has arrived at the scene to speak with emergency services and victims.