PESHAWAR, Pakistan — A doctor who helped the CIA hunt down Osama bin Laden was convicted Wednesday of conspiring against the state and sentenced to 33 years in prison, adding new strains to an already deeply troubled relationship between the US and Pakistan.

US officials had urged Pakistan to release the doctor, who ran a vaccination program for the CIA to collect DNA and verify the al-Qaeda leader’s presence at the compound in the town of Abbottabad where US commandos killed him in May 2011 in a unilateral raid.

In a joint statement, Senators John McCain and Carl Levin, senior members of the Senate Armed Services Committee, called Dr. Shakil Afridi’s sentence “shocking and outrageous.” McCain and Levin urged Pakistan to pardon and free the man “immediately.”

The lengthy sentence for Afridi will be taken as another sign of Pakistan’s defiance of American wishes. It could give more fuel to critics in the United States that Pakistan — which has yet to arrest anyone for helping shelter bin Laden — should no longer be treated as an ally.

US Defense Secretary Leon Panetta, who as CIA director oversaw the US raid on bin Laden, said in an interview aired Wednesday on the “CBS Evening News” that Afridi was “very helpful” with the operation.

“For them to take this kind of action against somebody who was helping to go after terrorism, I just think is a real mistake on their part,” he said.

The verdict came days after a NATO summit in Chicago that was overshadowed by tensions between the two countries that are threatening American hopes of an orderly end to the war in Afghanistan and withdrawal of its combat troops by 2014.

Islamabad was invited in expectation it would reopen supply lines for NATO and US troops to Afghanistan it has blocked for nearly six months to protest US airstrikes that killed 24 Pakistani troops on the Afghan border. But it did not reopen the routes, and instead repeated demands for an apology from Washington for the airstrikes.

Pakistan’s treatment of Afridi since his arrest following the bin Laden raid has in many ways symbolized the gulf between Washington and Islamabad.

In the United States and other Western nations, Afridi was viewed as a hero who had helped eliminate the world’s most-wanted man. But Pakistan army and spy chiefs were outraged by the raid, which led to international suspicion that they had been harboring the al-Qaeda chief. In their eyes, Afridi was a traitor who had collaborated with a foreign spy agency in an illegal operation on its soil.

Afridi, in his 50s, was detained sometime after the raid, but the start of his trial was never publicized.

He was tried under the Frontier Crimes Regulations, or FCR — the set of laws that govern Pakistan’s semiautonomous tribal region. Human rights organizations have criticized the FCR for not providing suspects the right to legal representation, to present material evidence, or to cross-examine witnesses. Verdicts are handled by a government official in consultation with a council of elders.

Afridi was tried in the Khyber tribal region, where he was raised. In addition to the prison term, he was ordered to pay a fine of about $3,500 and is subject to an additional 3½ years in prison if he does not, according to Nasir Khan, a government official in Khyber.

Afridi can appeal the verdict within two months, said Iqbal Khan, another Khyber government official.

An official with Pakistan’s main Inter-Services Intelligence agency said the decision was in Pakistan’s “national interest,” and he dismissed earlier appeals by US Secretary of State Hillary Rodham Clinton and other American officials that Afridi should be released. The official did not give his name because the ISI doesn’t allow its operatives to be identified in the media.

Asked in Washington to comment, Pentagon press secretary George Little declined to talk about the specific case, but added: “Anyone who supported the United States in finding Osama bin Laden was not working against Pakistan. They were working against al-Qaeda.”

Afridi was working for local health authorities in northwest Pakistan when he began working for the CIA. Nurses working for him reportedly knocked on the door of the compound in Abbottabad, but were not successful in obtaining a sample from the house to confirm bin Laden was living there.

After the raid, the Pakistan army kicked out US military trainers and limited counterterrorism cooperation with the CIA. But relations got even worse in November when the US killed the Pakistani border guards, an attack that Washington said was an accident but the Pakistani army insisted was deliberate.

Pakistan retaliated by closing the NATO supply routes and kicking the US out of a base used by American drones. Before the attack, the US and other NATO countries fighting in Afghanistan shipped about 30 percent of their nonlethal supplies through Pakistan. Since then, the coalition has used far more expensive routes through Russia and Central Asia.

The US has pressed Pakistan to reopen the supply line, but negotiations have been hampered by Washington’s refusal to apologize for the attack and stop drone strikes in the country as demanded by Pakistan’s parliament.

The latest drone strike took place Wednesday, when two missiles hit a compound in Datta Khel Kalai village in the North Waziristan tribal area, killing four suspected militants, said Pakistani intelligence officials, speaking on condition of anonymity because they were not authorized to give their names to the media.

Despite the tensions, most analysts believe the US cannot afford to turn its back on Pakistan entirely.

Pakistan is seen as vital to negotiating a peace deal with the Afghan Taliban and their allies, given the country’s historical ties with the militants. Many in the Pakistani government realize it needs to repair relations with the US, partly to receive more than a billion dollars in American aid.

Talat Masood, a retired Pakistani general who is now a defense analyst, said the ISI likely preferred to see Afridi tried under the FCR because it was easier to get a prosecution than in a regular court. He said the verdict may reflect Pakistani annoyance at perceived ill-treatment at the Chicago meeting, but that improved relations could see him released.

“If things go well with the US, it’s very likely that he will be pardoned,” he said.