BRUSSELS, Belgium - Departing Defense Secretary Robert M. Gates lashed out at some of America's closest European allies, complaining that NATO's shaky air assault in Libya had laid bare shortcomings that are pushing the alliance toward "collective military irrelevance."

In an unusual public rebuke Friday, Gates condemned European nations for years of declining defense budgets that he said had forced the United States to shoulder the heaviest load by far in the 62-year-old alliance.

Gates noted with frustration that fewer than half the 28 nations in NATO were engaged in the Libyan conflict, with fewer than a third conducting air strikes, even though the coalition unanimously backed the decision to take military action to protect civilians from Moammar Gadhafi's forces.

"The mightiest military alliance in history is only 11 weeks into an operation against a poorly armed regime in a sparsely populated country - yet many allies are beginning to run short of munitions, requiring the U.S., once more, to make up the difference," Gates said.

Gates, who will retire at the end of this month, said the United States was tired of engaging in extended, expensive combat missions for those who "don't want to share the risks and the costs."

The "blunt reality," he warned, is that Congress and the American public have "dwindling appetite and patience" to spend "increasingly precious funds on behalf of nations that are apparently unwilling to devote the necessary resources ... to be serious and capable partners in their own defense."

Gates described a NATO future that was "dim, if not dismal." But, he said, "it's not too late" for European governments to boost defense spending and strengthen their armed forces.

Gates gave his harsh assessment in a speech in Brussels as the Obama White House begins closed-door deliberations on how quickly to withdraw the U.S. military from the decade-old war in Afghanistan, where forces from several NATO nations also have taken part.

His comments run the risk of alienating allies at a critical time. Pentagon officials worry that when President Obama discloses his plan next month for how quickly to pull back from Afghanistan, it may embolden allies to accelerate their own withdrawals, despite a NATO timetable that calls for keeping troops in place until 2014.

In addition to Libya, NATO involvement in Afghanistan is significant. When the Obama administration sent 30,000 more troops to Afghanistan in late 2009, bringing the U.S. total to nearly 100,000, Britain, France, Germany, and Canada also raised their troop levels, doubling the non-U.S. NATO force level to 40,000.

More than 850 soldiers from NATO allies have died in that conflict, while more than 1,500 Americans have died.

Gates praised NATO for that role, but he also pointed out that many NATO nations restrict how their troops may be deployed and sometimes limit their combat roles. Many also rely on U.S. forces for airlift and helicopters, evacuation of wounded, and other key support, and they have refused pleas to increase their involvement.

NATO's formal role in Iraq was limited to training Iraqi forces, though British forces fought alongside U.S. troops during the 2003 invasion and were stationed in southern Iraq. Several other countries, including Spain and Poland, subsequently sent troops.

Gates' address followed two days of private meetings with fellow defense chiefs at NATO headquarters in Brussels. His critique was even more blunt during those sessions, U.S. officials said.

According to their accounts, Gates rebuked Germany and Poland for not participating in the Libya operation, and he urged Spain, Turkey, and the Netherlands - which are aiding the effort but not taking part in air strikes - to step up their role, according to officials familiar with the discussion.

European officials did not publicly react to Gates' speech, but one noted that several key allies, including Britain, France, and Canada, support the core of his argument. Another official said Gates was asking too much, given European political and fiscal realities.

"Many people will simply feel that they don't have much maneuver room on this when they look at public opinion and their budgets," he said.

Several officials said privately that Gates gave too little credit to NATO's role in Afghanistan. Nor, one European official said, was it fair to blame NATO for problems in Libya since Washington has stepped back from the conflict.

U.S. warplanes and missiles led the initial assault on Libya in March, but the Obama administration soon scaled back its involvement. The Pentagon now provides aerial refueling, targeting and surveillance, rescue, and other support functions.

When a military stalemate began to emerge, Gates agreed to provide several armed Predator drones, which have been used in air strikes. U.S. aircraft have flown 75 percent of the sorties, Pentagon officials said, but the United States has resisted pressure to send ground-attack helicopters or aircraft, which are designed to isolate and eliminate small targets.

Gates' critique drew support from both sides of the aisle in Washington.