US Gen David Petraeus lauded Pakistan's efforts at battling Islamist militants on Monday during his first visit since taking over as top NATO commander in neighboring Afghanistan this month.
But he avoided public mention of the complicated tug of war between the two countries over the presence in Pakistan's border regions of militants launching attacks against NATO troops in Afghanistan.
Pakistan is embroiled in military operations against Pakistani Taliban fighters in its volatile northwest.
One of Petraeus's main challenges as NATO commander will be to try to persuade its leaders to also turn their sights toward Afghan Taliban based in their country's semiautonomous tribal areas.
Pakistan has been wracked by a series of deadly attacks in the past two weeks that have killed nearly 150 people. Violence is also rising in Afghanistan. June was the deadliest month for international forces there since the start of the war nearly nine years ago.
"Recent events demonstrate both the common threat posed to Pakistan and Afghanistan by insurgents and the efforts that the Pakistan military are making to counter this threat," Petraeus said in a statement after meeting with Pakistani army chief Gen Ashfaq Parvez Kayani.
"I look forward to continuing to work with General Kayani to identify areas of mutual interest and to cooperate in efforts that can help improve regional security," he said.
Petraeus was previously serving as the head of the US military's Central Command, which oversees the wars in both Afghanistan and Iraq, and visited Pakistan several times in that capacity.
He took over in Afghanistan after Gen Stanley McChrystal was forced to resign over comments he and his aides made to Rolling Stone magazine critical of the Obama administration.
Pakistan has so far resisted US pressure to act against Afghan Taliban. Analysts say Pakistan's military believes the Taliban could be useful allies in Afghanistan once international forces withdraw. Pakistan helped the militant group seize power in Afghanistan in the 1990s.
Pakistan claims its forces are already stretched thin battling the Pakistani Taliban who have declared war on the Pakistani state.
A roadside bomb struck a vehicle carrying paramilitary troops in northwestern tribal area of Orakzai on Monday, killing one soldier and wounding four others, said Jehanzeb Khan, a local administrator.
The Pakistani military declared victory in Orakzai in June after pounding Taliban militants in the area for months with airstrikes and artillery. But militant attacks and military operations in the area have continued.
The Taliban have also orchestrated attacks far from their northwest sanctuary by teaming up with militant groups in Punjab, Pakistan's biggest and richest province.
Suicide bombers struck a famous Sufi shrine in the provincial capital of Lahore a little more than a week ago, killing 47 people.
Police have launched a crackdown against militant groups in Punjab over the past two days, arresting 98 people, provincial police chief Tariq Saleem Dogar said on Monday.
The arrests come amid criticism that the provincial government is unwilling to go after the groups, because they deliver votes during elections.
Punjab Law Minister Rana Sanaullah, who controls the provincial police, campaigned alongside members of one group in March.
Many of the groups were once supported by the government to fight the Soviets in Afghanistan and the Indians in Kashmir but have turned against their former masters because of Pakistan's close alliance with the US.
The US has worked to bolster Pakistan's fight against militants by providing billions of dollars in military aid and soldiers to train local paramilitary soldiers.
Three of those trainers were killed in February when their vehicle was hit by a suicide car bomber in Lower Dir district near the Afghan border.
Pakistani forces killed a Taliban commander in Lower Dir on Monday who they believe orchestrated the attack against the Americans, said security officials, speaking on condition of anonymity because they were not authorized to talk to the media.