Iraqi Prime Minister Haider al-Abadi, whose forces Thursday battled jihadists in the west of the country and Kurds in the north, won the support of Iranian leaders at talks in Tehran.
Supreme leader Ayatollah Ali Khamenei "gave his support for measures taken by the Iraqi government to defend the unity, sovereignty and territorial integrity of Iraq", Khamenei's office said in a statement after their meeting.
Abadi also held talks with President Hassan Rouhani who said Iran "has and always will stand alongside" Iraq "when it comes to fighting terrorism, reinforcing (its) unity and preserving its territorial integrity".
"The fight against terrorism and separatist goals... must be monitored and Tehran wants to contribute to reinforcing the Iraqi central government," Rouhani added, according to the presidency's website.
Buoyed by the success of the campaign against the Islamic State jihadist group and operations against the Kurds, Abadi has been on a regional tour that on Wednesday saw him in Ankara.
The Tehran stop came as Iraqi forces launched a new assault on Kurdish forces in a disputed area of Nineveh province, sparking heavy artillery exchanges, according to Kurdish authorities and correspondents in the region.
Government forces have since last week snatched back control of thousands of square kilometres (miles) of territory long disputed with the Kurds, in a feud which has boiled over since a Kurdish independence referendum held in defiance of Baghdad on September 25.
The vote organised by the leadership of autonomous Iraqi Kurdistan in the country's north angered neighbours Turkey and Iran, both fearful of anything that might stoke separatist sentiment among their own large Kurdish minorities.
Also on Thursday, federal troops and allied paramilitaries launched an offensive up the Euphrates Valley towards the Syrian border in a bid to retake the last IS bastion in Iraq.
Tehran has poured significant resources into the war against the jihadists in Iraq, providing weapons, advice and training to the Shiite militias which dominate the paramilitary force.
Its involvement has irked Washington but has been defended by the Iraqi prime minister, who gave a firm rebuff to US Secretary of State Rex Tillerson over his comments on the issue.
Abadi has been deeply defensive of his government's close alliance with neighbouring Iran, which like Iraq is a Shiite-majority country.
On a visit to Tehran's Sunni arch rival Riyadh on Sunday, Tillerson called for Iranian militias in Iraq to "go home" as the fight against IS was coming to a close.
The fighters of the paramilitary force are "Iraqis who have fought terrorism, defended their country and made sacrifices to defeat (IS)", Abadi said, according to a statement from his office.