Updated

U.S. 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. 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.

Service members repeatedly have quizzed Hagel about the budget and the potential effect on the military. But his response to a 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 between $10 billion to $25 billion each year, for the next two years, to defense spending.

Hagel said the possible deal could give the department two years of budget certainty. Defense and military officials have complained often that the past two years of congressional wrangling over the across-the-board cuts has made it difficult for the Pentagon to plan or handle contracts.

"I want to reassure you that we will take care of our troops first, our families, we will fund completely the priorities of our missions and you will get everything you need to do your mission," Hagel told the Marines.

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 huge 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.

Explaining his decision, Hagel said he did not think there was much he could add to what is already a straightforward U.S. message. The U.S. wants the agreement signed by year's end, although Hagel suggested a cutoff date could come as late as February when NATO ministers gather for a meeting in Brussels.

According to a senior defense official, Afghan leaders and military commanders told Hagel during his Sunday meetings that they want the agreement signed promptly because they need continued U.S. and coalition assistance.

The Afghans now conduct the bulk of the fighting missions, with the U.S. and coalition troops watching, giving advice and training and providing needed logistical and medevac support.

The Afghan leaders told Hagel that while they have much of the equipment they need, they rely on the coalition to provide the training and infrastructure for repairs and maintenance, said the official, who was not authorized to discuss the private meetings publicly and spoke only on condition of anonymity.

Karzai tentatively has endorsed the agreement and a council of tribal elders, the Loya Jirga, has said it should be signed by Jan. 1, as the U.S. has demanded.

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