BAGHDAD – Five American soldiers were killed Monday in an attack that marked one of the deadliest days in two years for American military in Iraq and underscored the continuing threats American troops face as they prepare to withdraw from the country.

United States officials provided few details, saying only that five service members had been killed in central Iraq. But an Iraqi security official said they were killed after three rockets launched form a Kia pickup truck struck an American base in eastern Baghdad.

There were no immediate claims of responsibility.

The toll was unusual at a time when American forces have largely pulled back behind the high concrete curtains of their bases. But American military officials have been bracing for an increase in attacks as militants use violence to inject themselves into the fiercely politicized debate over whether Iraq should ask American forces to stay after the end of the year.

As Iraqi politicians tiptoe into that highly charged discussion, American military officials say that militants are stepping up attacks against bases and convoys, especially in Iraq’s south, hitting them with mortars, rockets and improvised roadside bombs.

In Baghdad, the total number of mortar and rocket attacks against American and Iraqi targets jumped in to 37 in May from 17 in April.

American casualties have dropped sharply in the last few years, and only two American troops were killed last month. But 11 died in April, the most since November 2009, according to a tally kept by icasualties.org.

All of the 46,000 American forces still in Iraq are scheduled to withdraw by the end of the year under a security agreement signed by both countries. But their departure is far from certain.

Iraqi leaders are debating whether to ask some troops to stay behind to train Iraqi soldiers and help Iraq secure its borders and airspace. Prime Minister Nuri Kamal al-Maliki, said last month that he could support an extended American troop presence if a solid majority of Iraq’s leaders also stood behind it.

The attacks against the Americans were part of a bloody day across Iraq.

Elsewhere, gunmen and suicide bombers struck at Iraqi security forces and militias in three heavily Sunni Muslim areas, killing at least 21 people in attacks that challenged the government’s attempts to demonstrate gains in security.

In the worst of the attacks, a suicide bomber detonated a car filled with explosives at the main gates of the governmental headquarters in Tikrit, the hometown of Saddam Hussein. Security officials said 12 people were killed, nine of them Iraqi soldiers.

It was the second major attack in Tikrit in just three days. On Friday, a suicide bomber detonated an explosive device in the center of a mosque filled with worshippers, and hours later, a second suicide bomber attacked the hospital treating the wounded. Nineteen people were killed, including several local officials.

The head of national security in the province, Brig. Gen. Jasim al-Jabara, resigned after Monday’s attack, saying that security in his section of central Iraq had deteriorated sharply. He blamed other security agencies for failing to act on intelligence.

“We are giving some good information to the security forces in the province, but they are doing nothing,” General Jabara said.

In western Iraq, several miles west of Fallujah, militants aiming to kill a local police chief set off four improvised bombs at his home, killing his father, mother, sister and one of his children. The police chief survived.

And in Baghdad’s heavily Sunni neighborhood of Adhamiya, gunmen assassinated three members of the Awakening, the American-backed militia whose assaults against insurgents are credited with helping to tame Iraq’s once-rampant violence.

Duraid Adnan contributed reporting from Baghdad. Iraqi employees of the New York Times contributed reporting from Anbar and Salahuddin provinces.

This is our most important fundraising month and donations have been slower than we hoped. The reality is that we need to raise $157,000 in less than two weeks to keep going in 2019.

Whether you read Truthout often or just share our repulsion with Trump and his attacks on women, immigrants, the environment, journalists and pretty well everything we care about, we urgently need your help.

Less than two weeks left: Keep trustworthy journalism alive!

We urgently need to raise $157,000 in less than two weeks to keep Truthout going in 2019. This is our most important fundraising month, so whether you read Truthout often or just share our repulsion with Trump and his attacks on everything that matters, we are in serious need of your help. Will you take a moment to chip in so we can stay in the fight?

Subscribe to Truthout’s daily newsletter and never miss a story. We’ll send you the top news, analysis and commentary from Truthout’s reporters and leading progressive thinkers, as well as the best reprints from other independent news sources.