U.S. President Barack Obama warned Iran on Tuesday that its fighters must respect Iraq's sovereignty and answer to the government in Baghdad in the battle against Islamic State militants. Iran-backed Shi'ite militias have played a major and growing role in battling the Sunni Islamic State, an al Qaeda offshoot also known as ISIL, that emerged from the chaos in Iraq and neighboring Syria and which swept through northern Iraq last June. Iraqi Prime Minister Haidar al-Abadi has had to rely on Shi'ite militias, some of which are backed by Iran and advised by Iranian military officers, as Iraq's regular military deserted en masse last summer in the face of the Islamic State onslaught. Obama said he and Abadi discussed the issue at length in their Oval Office meeting on Tuesday. Asked about Iranian involvement in Iraq, Obama said that he expected the neighbors to have an "important relationship," and recognized that the mobilization of Shi'ite militias had been necessary to counter ISIL's advance last year. But he added that any foreign-backed groups in Iraq should now be under Abadi's control. "Once Prime Minister Abadi took power ... from that point on, any foreign assistance that is helping to defeat ISIL has to go through the Iraqi government. That's how you respect Iraqi sovereignty," Obama said. "It needs to be help that is not simply coordinated with the Iraqi government, but ultimately is answerable to the Iraqi government and is funneled through the chain of command."