BAGHDAD — The government of Prime Minister Nuri Kamal al-Maliki is privately telling American officials that it wants their Army to stay here after this year.

The Americans are privately telling their Iraqi counterparts that they want to stay.

But under what conditions, and at what price to the Americans who remain behind?

American combat deaths are on the rise, an ominous harbinger of what lies ahead if an agreement is reached to keep troops here after the withdrawal deadline at the end of the year. For the same Iraqi government that wants the Americans to stay is also tacitly condoning attacks by Shiite militias on American troops, by failing to respond as aggressively to their attacks as it does to those of Sunni insurgent groups like Al Qaeda in Mesopotamia.

The Maliki government’s unwillingness or inability to rein in the militias adds an element to a discussion that until now had been focused on the capabilities of the Iraqi security forces and the domestic political considerations in Washington and Baghdad, not the safety of American soldiers.