A video image shows an Afghan soldier carried to a hospital in Farah after a Taliban attack Wednesday.
KABUL—Afghanistan's intelligence chief returned to a hero's reception in Kabul after healing from a December assassination attempt, cementing his national status as a leading anti-Taliban figure on a day in which insurgents killed dozens of people.
Asadullah Khalid, director of the National Directorate of Security, met with Afghan President Hamid Karzai at the presidential palace and resumed his duties after his return on Wednesday. He now faces the difficult job of keeping the Taliban at bay as U.S. forces leave Afghanistan, which is facing presidential elections next year.
In the deadliest assault on Wednesday, Taliban insurgents disguised as Afghan soldiers killed more than 50 people at a courthouse in western Farah province, officials said.
The attack began when insurgents set off an explosives-packed Ford Ranger pickup truck outside the building, according to provincial Gov. Akram Khpalwak. Eight suicide attackers wearing Afghan National Army uniforms then stormed the courthouse, he said. A battle continued into the early afternoon until all of the attackers were killed.
The assault killed a dozen members of Afghan security forces and injured more than 100 people, Gov. Khpalwak said, while more than 42 "innocent citizens," were killed, the presidential palace said.
Asadullah Khalid, shown here in 2008, returned to Kabul on Wednesday after months recovering from an assassination attempt at hospitals in the U.S.
The Taliban claimed responsibility for the attack, which was one of the deadliest in recent years.
President Karzai condemned the attack in the strongest terms, saying Afghans "would not leave this genocide and massacre of Muslims unanswered."
Responsibility for security in most of Farah was handed to Afghan forces in December.
Afghanistan's western and northern provinces have seen less fighting than the country's south and east.
Separately, seven Afghan National Army troops died in insurgent attacks in Faryab, Kandahar, Kunar and Helmand provinces, the Afghan defense ministry said.
Mr. Khalid, the intelligence chief, was injured by a suicide bomber pretending to be a Taliban peace emissary at a National Directorate of Security guesthouse in downtown Kabul, an attack that appeared aimed to derail fragile efforts to broker peace with the insurgents.
He returns to Afghanistan as a political celebrity. Billboards and banners have sprung up in Kabul welcoming him home. "Your recovery is good news for the Afghan nation, and bad news for the enemies of Afghanistan," said one sign on the Kabul airport road.
Following the assassination attempt, Mr. Khalid underwent multiple surgeries and skin grafts in the U.S. While in a U.S. military hospital, he received visits from President Barack Obama, and then-Defense Secretary Leon Panetta. Mr. Karzai called on Mr. Khalid during an official visit to the U.S. in January.
A former governor of Ghazni and Kandahar provinces and minister of tribal affairs, Mr. Khalid is known in Afghanistan as a staunch opponent of the Taliban, and as one of the young Afghan leaders closest to Mr. Karzai.
During his term in Kandahar, he was accused by human-rights groups of running torture facilities—allegations he has denied.
He has said he provided covert aid last year to anti-Taliban rebels in the Andar district of Ghazni province, once a stronghold of the insurgency. The Andar anti-Taliban uprising—once billed as a spontaneous movement—has run into trouble without Mr. Khalid's support, and has largely become a government-backed force.
During his stay in the U.S., Mr. Khalid emerged as a social-media phenomenon. A Facebook FB +3.27% page run by admirers featured photos and videos that documented his recovery.
While the Internet is available to only a small percentage of the population in Afghanistan, the posts routinely drew hundreds of comments.
Majeed Qarar, who hosts one of the most-popular Afghan Facebook pages, said the support for Mr. Khalid appeared to be genuine.
"There are a big number of people who are against the Taliban," he said. "They see hope in Asadullah Khalid." —Habib Khan Totakhil and Ziaulhaq Sultani contributed to this article