There have been no immediate reports of causalities.
The blaze was triggered after liquid gas leaked from a pipeline and triggered an explosion according to the head of Tehran’s crisis management team, Mansour Darajati.
Mr Darajati promised there would be a full investigation of the causes of the incident.
Meanwhile, the head of the company in charge of the refinery reportedly told Iranian state TV the possibility of sabotage had been ruled out.
A spokesman for the Tehran Oil Refining Co denied “all speculation centering on sabotage.”
“The accident was caused by a technical problem and we are currently in the process of controlling the fire,” the spokesman added.
The fire has spread to the refinery’s oil storage tanks with as many as 18 having been set alight by the blaze, according to the Saudi news outlet Al Arabiya.
The incident took place near the geopolitically significant Straight of Hormuz through which much of the world’s oil trade flows.
Iran and Israel have repeatedly clashed over the waterway in recent years.
In 2019 a number of ships passing through the straights suffered mysterious explosions which the US pinned on Tehran.
Israel has long been linked with a series of “industrial accident” at key sites believed to have a role in Iran’s nuclear programme.