Defense Secretary Leon Panetta on Monday announced multimillion dollar grants to Bethesda and other communities affected by the military's base-closing process, but warned that Pentagon aid to communities would be endangered if Congress fails by the end of the year to head off $500 billion in automatic cuts to the defense budget.

Bethesda received $40 million to improve pedestrian and commuter access to the expended Walter Reed National Military Medical Center along Rockville Pike. A $5.7 million grant was make to Lakewood, Wash., for improvements at the Madigan Army Medical Center.

Panetta called the grants "a tangible sign of our commitment to working with communities impacted" by base closings. But he warned that such aid is imperiled by pending defense budget cuts that would kick in starting in January unless Congress can agree on a budget deal that would avert them.

The automatic budget cuts, Panetta said, represent "a mindless, indiscriminate formula that was never designed to be implemented, but if it is triggered it would do long-term damage to our military and to communities across the country."

He called on military-reliant communities to help pressure Congress to strike a deal that would allow the Pentagon to avoid the deep cuts.

"In the months ahead," Panetta said, "Congress must find a solution to avert this fiscal disaster, and frankly it is your responsibility to hold them accountable to do so."

Sara A. Carter is The Washington Examiner's national security correspondent. She can be reached at scarter@washingtonexaminer.com.