BAGHDAD — Even as the U.S. military winds down its eight-year war in Iraq, commanders are bracing for what could be the most dangerous remaining mission: getting the last troops out safely.

The resurgent threat posed by militants was underscored Monday when rockets slammed into a military base in eastern Baghdad, killing six service members in the most deadly day for U.S. forces here since 2009. In recent weeks, insurgent fighters have stepped up their efforts to kill U.S. forces in what appears a strategy to press the U.S. to withdraw on schedule, undercut any resolve to leave troops in Iraq, and to win a public relations victory at home by claiming credit for the U.S. withdrawal.

U.S. commanders say one of the gravest threats to the 46,000 troops here is that they could become easy targets for insurgents as they begin their final withdrawal this summer and head for the border along a 160-mile stretch of road cutting through the southern desert into Kuwait.

“Our forces were attacked today and we were just sitting still,” said Col. Douglas Crissman, who is in charge of U.S. forces in four provinces of southern Iraq, and is overseeing highway security in them. “What is going to happen to the threat when we line up our trucks to leave and start moving out of the country?”

Eight years in Iraq has taught the U.S. military a hard-learned lesson, that U.S. forces cannot effectively secure large areas without the help of the local people. So commanders have fashioned an exit strategy that borrows a key element from the Awakening Movement, a successful tactical program implemented in 2006, just as the violence was peaking. The U.S. exit strategy calls for the military to give cash payments of $10,000 a month to 10 tribal leaders.

Officially, the money is paid to have Iraqis clean the crucial roadway of debris, an apparent pretense because an Iraqi-American agreement bars outright payments for security. The sheiks keep some of the cash and use the rest of hire 35 workers each who clear the road of trash. The work does make it harder for militants to hide bombs.

But the military says it is aiming for more than a highway beautification project. It is hoping for local people to help police the road, the area and to provide intelligence on militants.

“I can’t possibly be all places at one time,” Crissman said. “There are real incentives for them to keep the highway safe. Those sheiks we have the best relationships with and have kept their highways clear and safe will be the most likely ones to get renewed for the remainder of the year.”