CAMP LEATHERNECK, Afghanistan - Defense Secretary Chuck Hagel on Sunday offered troops a rare glimmer of hope on the department's financial woes, saying a possible budget agreement back home could ease the automatic spending cuts that have hit the military hard.

Wrapping up a two-day visit to Afghanistan before stopping in Pakistan on Monday, Hagel told Marines at Camp Leatherneck that an emerging deal would restore some money to the Pentagon this budget year.

Hagel's time in Afghanistan was perhaps most notable for something he did not do - meet with President Hamid Karzai, who has rankled the U.S. officials by refusing to sign a bilateral security agreement before year's end.

The visit to Pakistan will be significant, too - the first by an American defense secretary since Robert Gates in early 2010. Relations between the two countries have seesawed over tensions about drone strikes and military operations along the Afghanistan-Pakistan border.

Priorities

Service members repeatedly have quizzed Hagel about the budget and the potential effect on the military. But his response to questions Sunday sounded a more optimistic tone than he has used for months.

At the same time, he said that whether or not the deal goes through, insuring that troops are ready for combat will continue to be a priority.

The automatic spending cuts, if they continue unchanged, would slice $52 billion from the department's budget in the fiscal year that began Oct. 1.

Officials have said U.S. lawmakers are negotiating a deal that could restore $10 billion to $25 billion each year, for the next two years, to defense spending.

Pique

Hagel traveled to southern and southwestern Afghanistan, meeting with commanders and local Afghan leaders for updates on the fighting season and the transition of the nation's security to Afghan forces.

He spoke to about 150 troops at Camp Leatherneck and to about that many soldiers at the U.S. military base in Kandahar.

Karzai visited Iran on Sunday, but he was in Kabul, the capital, when Hagel arrived Saturday. The slight by a senior U.S. official made clear the Obama administration's pique over Karzai's unwillingness to sign the stalled security agreement.

Karzai is holding up a pact that Washington and NATO officials say is critical to the plan to keep thousands of forces in Afghanistan after 2014 for a training and counterterrorism mission. He says he wants his successor to decide after Afghanistan's April elections.

Without a signed agreement, all U.S. troops and foreign forces would leave at the end of next year.