ISLAMABAD, Pakistan  Parts of the Pakistani military and intelligence services are mounting what American officials here describe as a campaign to harass American diplomats, fraying relations at a critical moment when the Obama administration is demanding more help to fight the Taliban and Al Qaeda.

The campaign includes the refusal to extend or approve visas for more than 100 American officials and the frequent searches of American diplomatic vehicles in major cities, said an American official briefed on the cases.

The problems affected military attachés, C.I.A. officers, development experts, junior level diplomats and others, a senior American diplomat said. As a result, some American aid programs to Pakistan, which President Obama has called a critical ally, are “grinding to a halt,” the diplomat said.

American helicopters used by Pakistan to fight militants can no longer be serviced because visas for 14 American mechanics have not been approved, the diplomat said. Reimbursements to Pakistan of nearly $1 billion a year for counterterrorism have been suspended because the last of the American Embassy’s five accountants left the country this week after his visa expired.