Congress has been so determined to take care of troops and their families that for several years running it has overruled the Pentagon and mandated more-generous pay raises than requested by the George W. Bush and Obama administrations. It has also rejected attempts by the Pentagon to slow soaring health-care costs -- which Defense Secretary Robert M. Gates has said are "eating us alive" -- by raising co-pays or premiums.

Now, Pentagon officials see fiscal calamity.

In the midst of two long-running wars in Iraq and Afghanistan, defense officials are increasingly worried that the government's generosity is unsustainable and that it will leave them with less money to buy weapons and take care of equipment.

With Washington confronting record deficits, the Pentagon is bracing for an end to the huge increases in defense spending of the past decade. On Saturday, Gates is scheduled to give a "hard-hitting" speech in Kansas on fiscal discipline, in which he will warn military leaders that "we'll have to take some dramatic measures ourselves to sustain the force we have," his press secretary, Geoff Morrell, told reporters.

Clifford L. Stanley, the undersecretary of defense for personnel, told a Senate committee in March that rising personnel costs could "dramatically affect the readiness of the department" by leaving less money to pay for operations and maintenance. Overall, personnel expenses constitute about one-quarter of defense spending.

Health care alone is projected to cost the military $51 billion next year, nearly one-tenth of the Pentagon's budget, excluding the costs of the wars in Iraq and Afghanistan. Since 2002, wages have risen 42 percent, compared with about 32 percent for the private sector. Housing and subsistence allowances, which troops receive tax-free, have gone up even more.

But Congress -- including members opposed to the wars -- has made clear that it considers military pay and benefits sacrosanct, especially when service members and their families are struggling to cope with repeated deployments to faraway conflicts.

"Both sides of the aisle are trying to send a very clear message to our military that we appreciate their service," said Rep. Susan A. Davis (D-Calif.), a member of the House Armed Services Committee and chairman of its military personnel subcommittee. She said the Pentagon needs to do a better job of setting priorities. "We end up with a false choice -- are we going to fund weapons or are we going to fund people? The reality is, we need both."

The Pentagon's attempts to rein in personnel costs have also run into opposition from powerful lobbying groups. "Any attempt to link rising military personnel costs with shrinking military readiness is total nonsense," Thomas J. Tradewell Sr., leader of the Veterans of Foreign Wars, said in response to Stanley's comments in March.

Advocates for troops and retirees say the main reason for the increase in wages is that they were way too low to begin with. In the late 1990s, after the military had been whittled down in size from its Cold War peak, studies found that service members earned about 13 percent less than workers in the private sector with similar experience and education levels.

Military officials said generous compensation packages were a primary reason they were able to meet all of their annual recruiting goals last year for the first time since the all-volunteer force was established in 1973. Although the recession also played a major role, military leaders said surveys show service members are generally happy with their pay scales.

Under current scales, an average sergeant in the Army with four years of service and one dependent would receive $52,589 in annual compensation, a figure that includes basic pay, housing and subsistence allowances, as well as tax benefits.

Vice Adm. Mark E. Ferguson III, the chief of naval personnel, said improvements in pay and benefits have made it more likely that sailors will stick around longer. Last year, a Navy survey found that about 60 percent of spouses wanted their sailors to make a career of Navy life, meaning a stint of at least 20 years. In 2005, he said, only about 20 percent of spouses felt the same way.

"I think pay was previously a concern, but it's started to change," Ferguson said. He added that Congress had been "extremely generous" but that rising personnel costs were already influencing what the Navy spends to operate, maintain and modernize its fleet.

The Pentagon wants a pay raise of 1.4 percent for service members next year, an increase based on the Employment Cost Index, which the Labor Department uses to measure private-sector salary increases. Congress, as it has for the past several years, has indicated it favors a slightly bigger bump, of 1.9 percent.

Todd Harrison, a defense budget expert at the Center for Strategic and Budgetary Assessments, said the extra half of a percent may not sound like much, but it would accrue annually and cost about $3.5 billion over the next decade. "If you continue doing it, it becomes a huge burden on the defense budget in the long term," he said.

Other well-meaning programs to support service members and their families have turned into budgetary Frankensteins.

In February, the Pentagon abruptly shut down a new tuition-assistance program for military spouses after it was overwhelmed with applicants. Defense officials had set aside $61 million for the program, which reimburses tuition costs of up to $6,000 per person, but discovered they might need as much as $2 billion to satisfy unexpected demand.

Congress chastised the Pentagon for mismanaging the program, which has since resumed, though defense officials aren't sure how they will pay for it.