In a message on Sunday, the Leader said the tragic fire incident at the Shahid Rajaee Port has caused sorrow and concern.
Ayatollah Khamenei urged security and judicial officials to identify any negligence or deliberate acts that may have caused the tragedy and to take necessary legal action in accordance with the law.
All officials must consider themselves responsible for preventing bitter and damaging incidents, he said.
Ayatollah Khamenei wished divine mercy and forgiveness for the deceased, patience and solace for the bereaved families of the victims, and a swift recovery for those injured.
The Leader expressed his sincere appreciation to all those compassionate people who were ready to donate blood to the injured in their time of need.
At least 40 people were killed and over 1,000 others wounded in the immense explosion that rocked the container port, which is located in Bandar Abbas and handles 80 million tons of goods a year.
The Iranian government declared Monday a day of national mourning after the tragic incident.