The U.S. is disappointed and suspicious that militants in Pakistan apparently were tipped off that American intelligence officials had discovered two of their suspected bomb-making facilities, Defense Secretary Robert Gates says.

But he stopped short of concluding that Pakistani officials leaked the information to the al-Qaida-linked Haqqani insurgents. And Gates said such incidents must not derail U.S. relations with Islamabad.

A little over two weeks before ending his 4 1/2-year tenure as Pentagon chief, Gates sat down in his office Monday for an Associated Press interview that touched on a range of issues, including his expectation of a smooth handoff to his designated successor, current CIA Director Leon Panetta.

Gates will retire June 30; Panetta's Senate confirmation is expected shortly. On Tuesday the Senate Armed Services Committee reported a unanimous voice vote to send his nomination to the floor of the Senate.

The Pakistan intelligence breach has only fueled unease in the U.S., where officials worry about links between the intelligence service there and some militant groups.

A U.S. official said Monday that after telling Pakistani intelligence about the location of the two compounds, U.S. drones and satellite feeds showed the militants clearing out the contents at both sites.

"We don't know the specifics of what happened," said Gates. "There are suspicions and there are questions, but I think there was clearly disappointment on our part."

As an act of faith to restore relations with Pakistan, U.S. intelligence in recent weeks shared the location of two such compounds believed to contain bomb material held by the Haqqani network. But by the time Pakistani authorities reached the facilities, they had been vacated.

The official, who spoke on condition of anonymity to discuss classified matters, said the assumption was that the Pakistanis had tipped off the Haqqanis.

Trust has been in short supply in the U.S.-Pakistani relationship, highlighted most dramatically by the U.S. decision not to tell Islamabad in advance of the May 2 Navy SEAL raid on Osama bin Laden's compound in Abbottabad, Pakistan, out of fear that they might tip off the al-Qaida leader or his protectors.

Daniel Benjamin, the State Department's counterterrorism coordinator, said Tuesday that bin Laden "obviously" benefited from a support network inside Pakistan.

Asked whether it was time to take a harder line with Pakistan, Gates counseled patience and noted that the Pakistanis have not forgotten that the U.S. abandoned them in the late 1980s after the Soviets pulled out of Afghanistan.

"We need each other, and this relationship goes beyond Afghanistan," he said. "It has to do with regional stability, and I think we have to be realistic about Pakistani distrust ... and their deep belief that when we're done with al-Qaida that we'll be gone, again."

Despite recurring tensions between Washington and Islamabad, and questions by some in Congress about the wisdom of having spent billions of dollars on aiding Pakistan since the Sept. 11, 2001, terror attacks, Gates said the effort has paid off.

On other topics, Gates said he sees no roadblocks to ending the ban on openly gay military service, and if the top officers of each service recommend moving ahead on the repeal before the end of the month, he will endorse it.

More than a million U.S. troops have been trained on the new law that repealed the 17-year-old ban on gays serving openly in the armed services, and Gates said the instruction has gone well.

"I think people are pretty satisfied with the way this process is going forward," he said. "I think people have been mildly and pleasantly surprised at the lack of pushback in the training."

Still, he noted that decades after women entered military service, there are still persistent problems with sexual assaults. So the notion that there will be no ugly incidents when the ban is lifted is "unrealistic," he said.

Under the law passed in December and in the detailed process laid out this year by the Pentagon, the military chiefs must report to Gates every two weeks on training progress and eventually need to make a recommendation on whether the repeal will damage the military's ability to fight.

If Gates approves the certification before he leaves office, the repeal could be fully implemented in September.

The most common question that has arisen during the troops' training, Gates said, has been on military housing. He said commanders are developing ways to deal with that.

Gates also sounded a cautiously optimistic note about developments in Yemen, where the government and opposition tribes have engaged in armed clashes, pushing the country toward civil war. He said things have calmed down a bit since President Ali Abdullah Saleh left for neighboring Saudi Arabia on June 5 for medical treatment of wounds he suffered in an attack on his compound in Yemen.

"I don't think you'll see a full-blown war there," Gates said. "With Saleh being in Saudi Arabia, maybe something can be worked out to bring this to a close" by finding an accommodation among Saleh's family, the opposition tribes and the military.

Gates, who originally opposed U.S. military intervention in Libya, predicted that strongman Moammar Gadhafi will fall — "whether it's of his own volition or somebody takes care of it for him." By that he meant either the military or his own family could turn against the longtime Libyan leader.

Reflecting on his imminent departure from a job he has described as the most rewarding in his long career of government service — including 27 years at the CIA — Gates said he is confident that Panetta will gain his footing quickly at the Pentagon.

"There is no lapse in terms of somebody getting up to speed on the issues," Gates said. "Essentially, Leon just changes place in the Situation Room," referring to the main crisis management room inside the White House.

"He's been in all the conversations on all the big issues, so there's just no catch-up time at all for him," he added.

Gates, 67, who is retiring to his home in the Puget Sound area of Washington state, said without hesitation that he will miss just two things about his job.

"One is the people that I work with, and the other is the troops. I won't miss anything else."


AP National Security Writer Anne Gearan and AP Intelligence Writer Kimberly Dozier contributed to this report.