In a message to his Indonesian counterpart Joko Widodo on Tuesday, President Rouhani said he was deeply saddened by the tragic incident.
In his message, the Iranian president also sympathized with the bereaved families of victims.
The Airbus A320-200, carrying 162 people from Surabaya in Indonesia’s east Java to Singapore, disappeared early Sunday. The AirAsia plane lost contact with the air traffic control in bad weather.
On Tuesday, Indonesian rescuers recovered bodies and debris confirmed to be from the missing plane in the Java Sea off the coast of Borneo.
Naval officials initially announced 40 bodies had been found, but the head of Indonesia’s search operation said only three bodies had been retrieved. The plane has yet to be found.
Shortly after the discovery was confirmed, the Indonesian president told media in a news conference that he had instructed all search teams to focus on finding the passengers and crew.
AirAsia CEO Tony Fernandes said he was "absolutely devastated" by the news.
"My heart is filled with sadness for all the families involved in QZ8501. On behalf of AirAsia, my condolences to all. Words cannot express how sorry I am," Fernandes tweeted.