BAGHDAD — Iraqi lawmakers approved a new power-sharing government led by Prime Minister Haider al-Abadi late Monday. But they left the two most divisive security posts unfilled, potentially extending a contentious debate even as American officials prepared a new campaign of military support for the Baghdad administration.

Mr. Abadi, a Shiite politician, has promised to preside over a more inclusive government that would set out to heal deep rifts with Iraq’s Sunni and Kurdish populations even as it struggles to beat back a catastrophic invasion by the Islamic State in Iraq and Syria.

“The country is exposed to an aggressive offensive, and the people are waiting for us all; we should not be arguing about names and positions,” Mr. Abadi said in his first official speech, urging sacrifice by Iraq’s political class. “This is to serve the country and the people.”

Mr. Abadi said he would initially run the Defense and Interior Ministries himself, and gave lawmakers a week to agree on new ministers before filling the posts with his own choices.