Congress on Friday passed another stopgap budget for the Pentagon despite a recent string of deadly naval and aviation mishaps and warnings from defense hawks and military leaders that years of such funding delays have worn down the services.

The continuing budget resolution, or CR, will maintain old fiscal 2017 funding levels for the military through December and was packaged with must-pass measures providing aid for Hurricane Harvey and raising the debt ceiling.

Both chairmen of the House and Senate armed services committees voted against the legislation, saying it harms the military.

"It's clear readiness is degrading, we are losing our technological advantage, the troops are under stress," said Rep. Mac Thornberry, R-Texas, following the House passage Friday morning. "A CR not only does not solve those problems, it continues to make them worse."

Sen. John McCain, R-Ariz., voted against the legislative package during the Senate passage on Thursday, saying it would worsen the state of the military even as the "overwhelming majority" of forces are not ready to fight a war in the near future.

"Year after year, I have reminded my colleagues that CRs are not only not the way to fund the government, they inflict great harm upon those Americans we are constitutionally obliged to provide for — our men and women in uniform," McCain said in a floor speech.

The CR will hold the Pentagon to current spending levels and prevent it from starting any new programs, even as President Trump and the House and Senate are eyeing big hikes in defense spending to shore up forces that many believe are underfunded and overburdened.

Defense Secretary Jim Mattis testified to both chambers of Congress in June that the use of the stopgap budget measures, along with federal spending caps, have created instability that is putting troops at risk.

Since then, the Navy has launched fleet-wide reviews after the USS John S. McCain and USS Fitzgerald destroyers collided with merchant vessels in the western Pacific in separate incidents that killed 17 sailors. The Marine Corps also ordered service-wide safety training after a KC-130 crash killed 16 troops and an MV-22 Osprey aircraft went down in the ocean off Australia, killing three Marines.