He made the remarks during a meeting with Turkish Foreign Minister Mevlut Cavusoglu in Tehran on Wednesday.
For his part, President Rouhani underlined the need for fighting against terror and foiling plots by foreign powers to divide the region.
"Unfortunately, today certain sides seek to alter geographical borders in the region and following their defeat in the north of Iraq, they embarked on hatching plots in northern Syria", Rouhani noted.
According to Anadolu Agency, the operation Olive Branch was launched to clear Kurdistan Workers' Party (PYD/PKK) and Islamic State (IS) terrorists from Afrin, northwestern Syria on January 20.
Russian Federation has also voiced concern about the Turkish military operation in Afrin.
Elsewhere in his remarks, the Iranian president underscored cooperation between Ankara, Moscow and Tehran with the aim of restoring unity to Syria, eliminating terrorism and establishing peace in the Arab country. The main principles of a political settlement were reached and a committee was formed to promote constitutional reform in the war-torn country.
Elsewhere in the meeting, Iranian president hailed Sochi summit's role in resolving the regional issues, saying "fortunately, the tripartite relations between Iran, Turkey and Russian Federation today are very important in regional affairs, while in the current situation, the need for further consultation and cooperation is needed to resolve the Syrian crisis".
The operation is being carried out under the framework of Turkey's rights based on worldwide law, UN Security Council resolutions, its self-defense rights under the UN charter, and respect for Syria's territorial integrity, the military said.