Ghaani is the commander of Iranâs Quds Force, which is mainly responsible for military and clandestine operations outside the country.
Iran enjoys wide influence in Iraq through powerful militias it has been backing for years. Iran and Iraq both have majority Shiite populations.
The failed assassination attempt against Prime Minister Mustafa al-Kadhimi at his residence has ratcheted up tensions following last monthâs parliamentary elections, in which the Iran-backed militias were the biggest losers.
Al-Kadhimi suffered a light cut and appeared in a televised speech soon after the attack on his residence wearing a white shirt and what appeared to be a bandage around his left wrist. Seven of his security guards were wounded in the attack by at least two armed drones.
There was no claim of responsibility but suspicion immediately fell on Iran-backed militias. They had been blamed for previous attacks on the Green Zone, which also houses foreign embassies.
The militia leaders condemned the attack, but most sought to downplay it.
The two Iraqi politicians quoted Ghaani as saying: âIran has nothing to do with this attack.â
One of the two officials said Ghaani met with al-Kadhimi on Sunday afternoon in Baghdad.
Lebanonâs Al-Manar TV, which is run by the Iran-backed Hezbollah group, said Ghaani also met with Iraqi President Barham Salih and other political figures in the country.
It quoted Ghaani as saying during his visit that âIraq is in urgent need for calm.â It added that Ghaani also said that any act that threatens Iraqâs security should be avoided.
The drone attack was a dramatic escalation in the already tense situation following the Oct. 10 vote and the surprising results in which Iran-backed militias lost about two-thirds of their seats.
Despite a low turnout, the results confirmed a rising wave of discontent against the militias that had been praised years before as heroes for fighting Islamic State militants.
But the militias have lost popularity since 2018, when they made big election gains. Many Iraqis hold them responsible for suppressing the 2019 youth-led anti-government protests, and for undermining state authority.
Some analysts have said that Sundayâs attack aimed to cut off the path that could lead to a second al-Kadhimi term by those who lost in the recent elections.
On Sunday, Iranâs Foreign Ministry spokesman Saeed Khatibzadeh condemned the assassination attempt on al-Kadhimi and indirectly blamed the U.S.
Al-Kadhimi, 54, was Iraqâs former intelligence chief before becoming prime minister in May last year. He is considered by the militias to be close to the U.S., and has tried to balance between Iraqâs alliances with both the U.S. and Iran.