Gates, in testimony before the Senate Armed Services Committee, addressed the matter after Pakistan urged the Obama administration over the weekend to halt such attacks. Two U.S. military strikes on targets inside Pakistan reportedly killed at least 20 people on Friday, and the Pakistani government said civilians were among those killed.
"I think that the strikes that are being undertaken are -- well, let me just say both President Bush and President Obama have made clear that we will go after Al Qaeda wherever Al Qaeda is, and we will continue to pursue them," Gates said.
Asked by committee Chairman Sen. Carl Levin, D-Mich., whether that decision has been transmitted to the government of Pakistan, Gates said, "Yes."
Gates also told the Senate panel on Tuesday that the Pentagon could send two more brigades to Afghanistan by late spring and a third brigade later in 2009 in an effort to try to salvage a country besieged by corruption and increasing violence.
More troops could be sent once the Defense Department is able to put a larger infrastructure in place to support them, he added.
Gates' testimony comes as Obama considers his options for a drawdown of troops in Iraq. The Pentagon is preparing various scenarios for winding down the war, including a plan that would cease U.S. involvement in combat within 16 months. Gates said military planners are looking at later dates as well and are prepared to brief Obama on all his options and their associated risks.
Obama planned to meet on Wednesday with the service chiefs, who are helping to prepare various scenarios for winding down the war. It will be Obama's first visit to the Pentagon since 2005 when he and other senators attended a breakfast with some senior military officials in his only visit on record, according to the Pentagon's legislative affairs department.
"I believe the president will have had every opportunity to hear quite directly from his commanders about what they can accomplish and what the attendant risks are under different options," Gates said.
It is Gates' first hearing since Obama took office, and lawmakers were eager to hear details about how the new president planned to proceed in Afghanistan.
"This is a long, hard slog we're in in Afghanistan," said Sen. John McCain, borrowing the phrase used frequently by former Defense Secretary Donald H. Rumsfeld to describe the war in Iraq.
"It is complex," added McCain, the top Republican on the Armed Services Committee. "It is challenging. And I don't see frankly an Anbar wakening -- a game changing event -- in Afghanistan, such as we were able to see in Iraq."
Security gains made in Iraq's Anbar province are often cited as a turning point in the Iraq war. Afghanistan is America's "greatest military challenge," and coordination of the fight against the insurgency has been "less than stellar," Gates said in his prepared remarks.
He said it will take a long and difficult fight to rout militants and help develop a nation that rejects the Islamic fundamentalist Taliban and backs its own elected government.
"There is little doubt that our greatest military challenge right now is Afghanistan," Gates said.
Having recently undergone an operation to repair a damaged tendon in his left arm, Gates spoke with his arm in a sling, his coat half on.
Obama has vowed to shift military resources away from Iraq and move them toward Afghanistan and Pakistan, which he says is the central front in the struggle against terrorism and extremism. In a plan initiated during the Bush administration and endorsed by Obama, the Pentagon is planning to double the 34,000 contingent of U.S. forces in Afghanistan.
But expectations in the troubled region may have to be tempered as top military advisers focus on showing even small security gains and development progress quickly.
"That's clearly the message I'm getting is, 'What are the near-term goals going to be?' " Adm. Mike Mullen, chairman of the Joint Chiefs of Staff, said when asked about Obama's agenda for Afghanistan.
While lawmakers mostly support the plan to send more troops, several Democrats have expressed the need for a clearer strategy.
Without an idea of when the commitment would end, "we tend to end up staying in different places and not necessarily resolving problems in a way that fits our national interest," said Virginia Sen. Jim Webb, a Democrat and a Senate Armed Services Committee member.
The Associated Press contributed to this report.