After decades of Turkish military activity in northern Iraq, Ankara and Baghdad reached a deal for Turkish forces to gradually transfer control of a base in Sinjar to the Iraqi army. Baghdad pledged to tackle armed groups that Turkey says pose a cross-border security threat.