The key to understand what was happening is in this paragraph.Malaki had to deal with different factions publicly but everyone knew, or should have known, that Iraq couldn't survive without US military presence. Do you believe that if Obama knew what was going to happen he would still have withdrawn all US troops? And if Malaki forced the US to withdraw why did Biden call it 'the greatest achievement'? Or Obama call it 'stable'. and that he was pulling out the troops as per his election promise?Mr. Maliki's new majority depends partly on followers of anti-American cleric Moqtada al-Sadr. But Mr. Biden credited Mr. Maliki for denying Mr. Sadr's bloc any control of Iraqi security, while forming a government with full buy-in from Iraq's main factions of Sunnis, Shiites and Kurds.
This is really something you should read, and it quotes Barrack Obama directly. Barack Obama declares Iraq war a success | World news | The Guardian
That was the SOFA agreement which was expiring and expected to be re-negotiated.And for those who are piling on Obama for withdrawing. You do realize that A 2008 (Pre Obama) security deal between Washington and Baghdad called for all American forces to leave Iraq by 2011? If anything Obama extended our stay there.