Panetta told reporters that a recent wave of violence, including a bombing in Kandahar on Wednesday that killed at least 22 people, was a possible signal that the Taliban and other groups are changing tactics.

"I think it's important to make sure we are aware of the kinds of attacks they're going to engage in ... as we go through the rest of the summer," Panetta said. Violence traditionally spikes in the warm-weather months.

Panetta met with Marine Gen. John Allen, the U.S. commander of Western forces in Afghanistan, and U.S. Ambassador Ryan Crocker, who will soon leave his post for health reasons. Panetta was also consulting with his Afghan counterpart, Defense Minister Abdul Rahim Wardak, as he wrapped up a nine-day trip across Asia.

Addressing a group of U.S troops, many of whom are heading home from Afghanistan in the next few days, Panetta noted the recent spate of attacks and said: "There is an uptick obviously, as we all expected, but the level of violence remains down from the past."

Panetta emphasized that the U.S. would take action to protect its troops from attack by insurgents based in Pakistan. "Let me be very clear. Anybody who attacks U.S soldiers is our enemy. We're not going to take it."

[Updated, 4:04 a.m., June 7: Wardak, at a joint news conference with Panetta, sounded worried about planned U.S. troop withdrawals. He emphasized that the U.S. had promised periodic reviews of troop levels and the security situation, implying that if violence continued to rise, Afghan officials might press to slow the pullout of international forces.]

The U.S. has stepped up drone strikes in Pakistan's border areas in recent weeks, partly in an effort to inflict losses on insurgents responsible for mounting attacks inside Afghanistan, a senior U.S. official said.

The official said the U.S. has run out of patience with Pakistan over its refusal to crack down on insurgent sanctuaries.

With 23,000 American troops due to depart by the end of the summer, the NATO force is accelerating efforts to hand over fighting duties to Afghan troops. That effort has met with mixed success, though Western officials say progress is being made.

Wardak and other senior Afghan military officials have said the Afghan police and army need more sophisticated weaponry.

Panetta's trip, his fourth to Afghanistan since taking office last year, also coincides with tensions over what Afghan officials claim was an errant U.S. airstrike that killed up to 18 civilians a day earlier. The NATO force said it was targeting a Taliban commander and acknowledged injuries to two civilian women, but no fatalities.