Washington (CNN) -- The nation's top military man warned Wednesday that the United States must continue to work with Pakistan as a partner despite years of mistrust.
Joint Chiefs Chairman Adm. Mike Mullen did not directly refer to the latest point of tension between the countries: Pakistani authorities' arrests of people who provided assistance and information before the successful raid on the Osama bin Laden compound and the killing of the al Qaeda leader.
However, Mullen said Pakistan remains crucial to U.S. strategy.
"We must continue to pursue a partnership with Pakistan," Mullen told the Senate Appropriation panel's defense subcommittee. "The alternative -- drifting toward a more contentious or fractured relationship -- is far more detrimental to U.S. interests in strategically defeating al Qaeda and ensuring nuclear weapons do not fall into terrorists' possession."
Defense Secretary Robert Gates appeared with Mullen to give his last testimony before his retirement at the end of the month. When asked about rocky relations with allies such as Pakistan and Afghanistan, Gates offered some political reality on global diplomacy.
Sen. Patrick Leahy, D-Vermont, asked Gates how long the United States should support "governments that lie to us," adding: "When do we say enough is enough?"
Gates responded that "based on 27 years in the CIA and four and a half years in this job, most governments lie to each other. That's the way business gets done."
"Do they also arrest the people that help us when they say they are allies?" Leahy asked, in clear reference to Pakistan's actions against officials who helped the U.S. raid on bin Laden's compound.
"Sometimes," Gates said, "and sometimes they send people to spy on us and they are our close allies.
"That's the real world that we deal with."
Wednesday's hearing examined the defense budget in a political climate of increasing pressure to reduce spending. Since the killing of bin Laden, calls have increased to end the Afghanistan mission earlier than the 2014 target date set by NATO.
President Barack Obama has long said the initial withdrawal of U.S. forces from Afghanistan would begin in July, and the question now is how large of a first step he will take. Military commanders are preparing recommendations, and Obama is expected to make a decision in coming weeks.
A letter Wednesday from 27 senators to Obama called for revising the Afghanistan mission, starting with a "significant and sizable" reduction in U.S. forces there beginning in July.
"According to our own intelligence officials, al Qaeda no longer has a large presence in Afghanistan, and, as the strike against bin Laden demonstrated, we have the capacity to confront our terrorist enemies with a dramatically smaller footprint," said the letter signed by 24 Democrats, two Republicans and one independent who caucuses with the Democrats. "The costs of prolonging the war far outweigh the benefits. It is time for the United States to shift course in Afghanistan."
It urged Obama "to follow through on the pledge you made to the American people to begin the redeployment of U.S. forces from Afghanistan this summer, and to do so in a manner that is sizable and sustained, and includes combat troops as well as logistical and support forces."
Mullen, however, warned Wednesday of increased problems in the region if the United States backs out of the Afghanistan mission now. The result probably would be a need to return a decade from now to face "a more dangerous situation," he said.
In response to concerns about the commitment to shared goals by Afghan President Hamid Karzai, Gates said one problem has been that the United States and its allies have failed to listen when Karzai raised specific complaints. Karzai has gone public about problems involving alliance forces long after he first raised the issues with U.S. and NATO commanders, Gates said.
According to Gates, Karzai has told him he plans to step down when his current term ends in 2014, which also is the year when the U.S.-led mission is supposed to turn over all security responsibility to Afghanistan forces.
Referring to Obama's goal of cutting $400 billion from the Pentagon budget over the next five years, Gates again warned that the wrong kinds of cuts and reduced funding for the military carry additional risk for the nation.
Mullen noted the difficult choices ahead, saying they will be "painful ... but they're absolutely necessary." At the same time, he told the panel that reducing U.S. military forces will necessarily affect the ability to conduct future operations.
"I'm actually pretty comfortable with where we are right now," Mullen said, later adding: "If we have to reduce our force structure, it will have an impact in the long run."
Both Gates and Mullen were talking about next year's defense budget, which includes $553 billion and an additional $117 billion for overseas operations, primarily the war in Afghanistan. Gates, just back from his 12th visit to Afghanistan, said he had seen "impressive progress" there.
Noting that the appearance was his last before the committee, Gates joked, "This time I mean it" in reference to having stayed in his job under Obama despite his known eagerness to retire earlier.
CNN's Tom Cohen and Ted Barrett contributed to this report.