Haji Gulalai, then an Afghan intelligence chief, is in sunglasses to the right of Afghan President Hamid Karzai in 2002. Gul Agha Sherzai, governor of Kandahar, is on the other side of Karzai. (Tomas van Houtryve/ASSOCIATED PRESS)

In Afghanistan, his presence was enough to cause prisoners to tremble. Hundreds in his organization’s custody were beaten, shocked with electrical currents or subjected to other abuses documented in human rights reports. Some allegedly disappeared.

And then Haji Gulalai disappeared as well.

He had run Afghan intelligence operations in Kandahar after the U.S.-led invasion in 2001 and later served as head of the spy service’s detention and interrogation branch. After 2009, his whereabouts were unknown.

Because of his reputation for brutality, Gulalai was someone both sides of the war wanted gone. The Taliban tried at least twice to kill him. Despite Gulalai’s ties to the CIA and Afghan President Hamid Karzai, United Nations officials and U.S. coalition partners sought to rein him in or have him removed.

Today, Gulalai lives in a pink two-story house in Southern California, on a street of stucco homes on the outskirts of Los Angeles.

View Graphic The ten provinces with multiple incidents of torture by Afghanistan's intelligence service the National Directorate of Security (NDS).

How he managed to land in the United States remains murky. Afghan officials and former Gulalai colleagues said that his U.S. connections — and mounting concern about his safety — account for his extraordinary accommodation.

But CIA officials said the agency played no role in bringing Gulalai into the country. Officials at the State Department and the Department of Homeland Security would not comment on his relocation or immigration status, citing privacy restrictions. Gulalai and members of his family declined repeated inquiries from The Washington Post.

As the United States approaches its own exit from Afghanistan, Gulalai’s case touches on critical questions looming over that disengagement. What will happen to thousands of Afghans seeking to accompany the American exodus? And how will U.S.-built institutions in that country — particularly its intelligence service, the National Directorate of Security (NDS) — treat those left behind?

Despite a substantial record of human rights abuses, Gulalai was able to bypass immigration barriers faced by Afghans whose work for the United States made them potential targets of the Taliban. Many have been turned away because of security objections submitted in secret by U.S. spy agencies.

Since its inception, the NDS has depended on the CIA to such an extent that it is almost a subsidiary — funded, trained and equipped by its American counterpart. The two agencies have shared intelligence, collaborated on operations and traded custody of prisoners.

Gulalai was considered a particularly effective but corrosive figure in this partnership. He was a fierce adversary of the Taliban, officials said, as well as a symbol of the tactics embraced by the NDS.

“He was the torturer in chief,” said a senior Western diplomat, who recalled meeting with a prisoner at an NDS facility in Kabul to investigate how he had been treated when Gulalai entered unannounced. The detainee became agitated and bowed his head in submission. “He was terrified, which made sense,” the diplomat said. Gulalai was “a big wheel in a machine that ground up a lot of people.”

U.S. officials said the CIA has taken measures to curb NDS abuses, including training its officers on human rights and pushing the organization to allow access to the International Committee of the Red Cross and other monitoring groups. But even after Gulalai’s departure, U.N. reports have documented widespread mistreatment of prisoners by the NDS.

Retired Marine Gen. John R. Allen, who was commander of coalition forces in Afghanistan until last year, warned that “human rights is going to be a weakness for some period of time.” Allen, who suspended prisoner transfers to the NDS after reports of abuse, said the organization has made progress but described its reliance on torture as an institutional “reflex.”

A ‘cruel position’

Now in his early 60s, Gulalai lives in a rented house in a Los Angeles suburb where the dry heat and backdrop of brown hills are reminiscent of Kandahar. His front yard is surrounded by a tall, white fence with a locked gate at the sidewalk. There are citrus trees in the back and a steady hum from a freeway a block away.

Gulalai, whose real name is Kamal Achakzai, shares the house with a mix of family members, including his wife and children, who range in age from toddlerhood into their twenties. “They generally keep to themselves,” a neighbor said. “They don’t speak except to say hello.”

A burly man matching Gulalai’s description backed out of the family’s driveway on a recent afternoon. He stopped briefly to roll down his window when approached by a reporter for The Post, but then sped off without comment.

In Southern California, Gulalai is surrounded by a network of Afghans, some of whom have known him since childhood. “We see each other every weekend, we play cards together,” said Bashir Wasifi, who attended school with Gulalai in Kandahar in the 1960s before moving to the United States in 1979.

Wasifi said Gulalai showed up unexpectedly with a dozen or more relatives several years ago, after the Taliban had killed two of his brothers and a son. The circumstances convinced local Afghans that Gulalai had received special U.S. help. “He was brought here by your government,” Wasifi said.

Gulalai has struggled to adapt. He doesn’t have a job and has learned little English. It is unclear how the family is supporting itself, although friends and relatives said that Gulalai’s sons are employed and that the family owns property in Afghanistan.

The stature that came with his high-ranking position and powerful clan connections in Afghanistan are gone. But Wasifi said that Gulalai also left behind the violence associated with that life and is attempting to make the best of his new circumstances.

“His position was a cruel position so he did cruel things, but he is not like that,” Wasifi said. “He worked with your government for 10 years. He hunted al-Qaeda for 10 years. What [more] would you want?”

Starting from scratch

After the Sept. 11, 2001, attacks, Gulalai was among a core group of Pashtuns recruited by the CIA to help the agency and U.S. Special Operations teams seize Kandahar, the city that had been the Taliban’s traditional stronghold. Gulalai had grown up there surrounded by prominent fighters in the CIA-backed effort to oust the Soviets from Afghanistan, many of whom went on to become members of the Taliban or senior officials in Karzai’s government.

Gul Agha Sherzai, a childhood classmate, called Gulalai “the roughest kid in school.” Sherzai, who was a candidate for president of Afghanistan this year, led the effort to recapture Kandahar in 2001. When he was named governor of the province a year later, he turned to his friend Gulalai to run security and intelligence operations.

At the time, the CIA was trying to cobble together a national intelligence service that could protect the Afghan government from internal threats as well as track down al-Qaeda operatives. The agency sought to fuse informant networks established by the Northern Alliance — which had worked with the CIA for years before the Sept. 11 attacks — with the remnants of a Soviet-era service known as the KHAD.

“It was chaos; you had to start from scratch,” said a former senior U.S. intelligence official involved in the effort. The agency equipped the NDS with a fleet of vehicles brought up through Pakistan, delivered office supplies to a Kabul building that the Taliban had trashed and provided a stream of cash to cover payroll. “Money would come in on aircraft, we’d put it through a counting machine and distribute it in duffel bags,” said the former U.S. official, who spoke on the condition of anonymity to discuss the CIA’s role.

The agency brought in retired operatives to teach courses in basic espionage and combine the disparate NDS elements into a coherent structure. The CIA secretly turned some of its better students into informants on the agency payroll, former officials said.

The training sessions also covered laws against torture. “It was obligatory, mandatory,” the former U.S. intelligence official said. “Whenever [NDS] captured anybody, we’d say you have to respect their human rights.”

That message came amid other conflicting signals.

Even while holding classes on the humane treatment of detainees, the CIA was setting up secret prisons where al-Qaeda suspects were subjected to brutal measures, including waterboarding. At one of the agency’s detention sites in Afghanistan known as the Salt Pit, a prisoner froze to death in 2002 after being doused with water and left alone overnight.

The NDS became an extension of the CIA with considerably greater size and reach. It grew to more than 20,000 employees and established a network of dozens of prisons in facilities that in some cases had served the same purpose under Taliban, Soviet and even 19th-century British rule.

In a war that came to be defined by an escalating cycle of raids and arrests, the NDS became a critical repository, taking custody of thousands of prisoners captured by the CIA, the U.S. military and coalition forces.

The NDS branch in Kandahar was a major destination for these deliveries, with a large prison near Kandahar airport, as well as off-the-books interrogation cells hidden among walled compounds in residential neighborhoods, former detainees and Western officials said.

Sardar Mohammad, a Kandahar resident, said he was held for months in an NDS cell after a team of U.S. Special Operations forces burst into his home in 2002. Gulalai took part in the raid, Mohammad said, and participated in interrogation sessions that included one of his brothers and a son.

“Every night, they beat me,” Mohammad said. He was released after his family paid 3,000 Pakistani rupees, he said, but was arrested again later and taken to a CIA compound known as Camp Gecko before being returned to NDS. There, Mohammad said, his interrogators called him “a personal detainee of Gulalai.”

A senior Afghan official who worked with NDS said Gulalai used his position to settle tribal scores and enrich his clan. Weapons seized by the NDS were sent to an arms depot in Gulalai’s home town of Gulistan, the official said. Prisoners’ families were routinely forced to pay ransom for their release.

“He tortured and took money from them,” the official said.

Critics said that Gulalai’s tactics also drove neutral Afghans into the enemy’s ranks.

Among them was Was Abdul Wasay, who later became the Taliban’s “shadow governor” in Kandahar, an unofficial position common across areas of Afghanistan where the Taliban still exerts influence and seeks to challenge the Kabul government’s authority. The senior Afghan security official described an early encounter at an NDS prison with Wasay, who accused Gulalai of strapping his father upside down to a door and leaving him in public view.

“I saw my father like this and I decided I must fight the government,” Wasay said, according to the Afghan security official, who would discuss security matters only on the condition of anonymity. Wasay continued that fight for a decade until Afghan military forces killed him this month, U.S. and Afghan officials said.

Defenders of Gulalai said that his daunting and dangerous job — to secure a province that had served for years as the base of operations for the Taliban and al-Qaeda — required him to be ruthless. Kandahar was a focal point of the war. Senior officials there were frequent targets of assassination attempts, including one of Karzai’s brothers, who was killed.

Sherzai, the former Kandahar governor, disputed the allegations about his intelligence chief, saying: “He was a very brave and strong man. I deny that he tortured anyone. He was under my command and I would not have allowed him to do that.”

A surge in abuse allegations

By 2005, Gulalai had survived multiple attempts on his life as well as mounting pressure on the government to remove him from his job. A bombing at his family’s residence killed one of his brothers but missed its intended target, said Afghan officials and Gulalai associates.

Twice, U.N. officials persuaded then-NDS Chief Amrullah Saleh to issue orders firing Gulalai. Both times, the orders were undone by ethnic politics, U.N. officials said, as Karzai countermanded the Tajik NDS chief to protect his fellow Pashtun tribesman.

Instead of being dismissed, Gulalai was promoted to NDS headquarters in Kabul and put in charge of the agency’s investigations directorate, known at the time as Department 17. The position gave him authority over the main NDS prison in Kabul, to which detainees from across the country were sent for long-term custody.

Allegations of abuse surged.

A secret memo circulated among senior U.N. officials and Western diplomats in late 2007 described NDS torture as “systemic” and identified Gulalai as singularly responsible.

Gulalai was “personally involved in conducting beatings amounting to torture, in detaining suspects illegally and arbitrarily and in deliberately and systematically evading detention monitoring,” the memo said. It cited unverified allegations of “disappearances” as well as testimony of “an extra-judicial killing and cover-up [that] seems very credible.”

Gulalai’s methods “included beating with a stick to the point of drawing blood, sleep deprivation for as long as thirteen days, protracted periods fastened with handcuffs and chains and suspension from the ceiling,” the memo stated.

The harshest treatment was reserved for Gulalai’s “personal prisoners,” those suspected of being involved in attacks against his family or clan. “They were held in underground cells, including in the cellars of the Investigation Directorate main offices,” the memo said.

Overall, Gulalai operated in a “culture of impunity” enabled by his close ties to high-ranking Afghan officials and status as “a key partner for international agencies working on counter terrorism and insurgency” — an apparent reference to the CIA and U.S. Special Operations forces.

A family forced to flee

Ultimately, the growing danger to Gulalai and his family prompted him to plan the exit that diplomats and rights groups had been unable to engineer.

In March 2007, Gulalai narrowly survived an attack by a suicide bomber near the entrance of a prominent Kabul mosque. An incident report contained in the WikiLeaks collection of leaked diplomatic files said that “General Gulalai” was among 12 injured in the attack, which also killed at least two civilians.

Gulalai’s son Raqib Achakzai said in a brief telephone interview last month that the family was forced to flee.

“They killed my cousins, four or five uncles, that’s why we came out here,” said Achakzai, who indicated that he works as a contractor for the U.S. military in North Carolina. He declined to discuss details of the family’s departure from Afghanistan, however, saying, “These are questions I’m not about to answer.”

CIA officials denied any involvement. “The CIA had no role whatsoever in facilitating the relocation of Haji Gulalai from Afghanistan to the United States,” agency spokesman Dean Boyd said.

Instead, Gulalai and his family apparently secured permission to travel to the United States, possibly under a “parole” designation used by the Department of Homeland Security to help foreigners facing medical emergencies or other extreme circumstances. Once in the country, Gulalai was granted asylum, said an official familiar with the case.

Asylum is designed to grant safe haven to foreigners who are likely to be arrested, tortured or killed if they return home. But U.S. law bars the granting of asylum to those who have persecuted others.

The required legal forms ask applicants whether they have “ever ordered, incited, arrested or otherwise participated in causing harm or suffering to any person” because of race, religion, nationality or other affiliation. But there is limited ability to check the accuracy of the responses.

Applicants are screened against databases for criminal convictions or terrorist ties. But experts said those records are unlikely to reveal allegations of human rights abuses, particularly when the alleged abuser was operating under government authority and was not arrested or publicly accused. Prospects of detection may have been further complicated by the fact that Gulalai used only his Achakzai name once in the United States.

There is at least one indication, however, that U.S. authorities were able to connect the asylum seeker to his NDS résumé.

At a hearing before an immigration judge in Los Angeles several years ago, Gulalai defended his asylum claim by presenting photos of the Kabul bombing and other evidence of the danger he faced in Afghanistan, said Wasifi, who accompanied his friend to help interpret.

A U.S. attorney challenging the claim asked repeatedly whether the man now calling himself Achakzai was ever known by another name. After getting only looks of bewilderment, Wasifi said, the attorney changed his question: “Then who is Gulalai?”

Gulalai chuckled and replied that it was just a nickname bestowed by his family, and apologized for the slip, Wasifi said. He emerged from the hearing with his immigration status intact.

Lea Greenberger, the attorney who, Wasifi said, represented Gulalai at the hearing, declined to discuss details of the case. “I will not represent people who violated human rights,” she said, but noted that lawyers don’t always have complete information about their clients. Clear answers on eligibility for asylum can be elusive, she said, especially when applicants come out of countries as ravaged by conflict as Afghanistan.

“If there were a clear black-and-white line, it would make things easier, but there isn’t,” Greenberger said. “In wars there are heroes who massacred others.” To some, she said, “a violation of human rights against the Taliban is perhaps an act of courage.”

A contradictory mission

As Gulalai settled into life in Southern California, the United Nations and other groups embarked on more comprehensive efforts to investigate alleged prisoner abuse by the NDS as well as the Afghan army and police.

In 2011 and 2013, the U.N. Assistance Mission in Afghanistan issued reports based on interviews with hundreds of prisoners that found evidence of torture at NDS facilities nationwide.

The problem was particularly acute at five sites, including Kandahar, where two-thirds of the prisoners interviewed said they were “systemically tortured.” Many were beaten with cables, forced to endure electric shock to the testicles, or handcuffed in excruciating positions for days at a time. One detainee “reported that an NDS official removed his toenail with a knife.”

The reports, released a decade into the war, triggered significant if belated reforms.

In 2011, Allen suspended detainee transfers and imposed new requirements, including regular inspection and certification of NDS prisons by U.S. and coalition military teams before transfers could resume.

Allen said he does not think the CIA encouraged or tolerated abuse. Instead, he said, the problem was deeply ingrained, with causes including the coarsening effect of decades of conflict as well as the influence of a justice system that relies on coerced confessions to function.

“To its credit, the NDS seems committed to ending torture,” he said, “but eliminating this practice will be a heavy lift.”

The CIA was not obligated to abide by Allen’s suspension or new restrictions, officials said. Boyd, the CIA spokesman, said that although the agency “can’t publicly discuss the significant steps we’ve taken to help NDS address these issues, we take seriously any allegations of abuse.”

Others, however, said the United States disregarded the problem for the better part of a decade and never imposed serious sanctions, such as cutting off NDS funding, even after the evidence of abuse was overwhelming. Some cited the seemingly incompatible U.S. objectives in Afghanistan, where the desire to build humane government institutions could be offset by the imperative to root out the Taliban and terrorism at almost any cost.

“The fact is our mission is internally contradictory,” said Barnett Rubin, a professor at New York University who is also senior adviser on Afghanistan and Pakistan at the State Department. When U.S. troops depart, he said, “we will leave a deeply corrupt and abusive government on whose territory there are virtually no members of al-Qaeda to be found.”

NDS spokesman Lutfullah Mashal declined to discuss Gulalai’s tenure or departure, citing a policy against revealing information about employees of the spy service.

In 2012, the NDS created a new human rights unit to investigate alleged abuse. The British government helped install cameras in NDS interrogation booths. Mashal said that such changes had eradicated a problem that he insisted had been exaggerated. “I deny any kind of torture by NDS at all,” he said.

A third report by the United Nations, expected to be released in the coming months, is said to cite progress on detainee treatment but also evidence of ongoing torture. “Despite significant remedial steps, torture continues because there’s no real deterrent,” said Georgette Gagnon, U.N. human rights chief in Afghanistan. “We’re not aware of any NDS official who has been prosecuted or fired for using torture.”

Gulalai has made several return trips to Afghanistan in recent months to sell property there, family members and associates said. If true, the visits could undermine the argument that Afghanistan had become too dangerous for him, potentially complicating his asylum claim.

Afghans who worked as interpreters or security guards or in other capacities for the U.S. military and other agencies have overwhelmed a special U.S. visa program, seeking to escape before American forces depart. The State Department has granted visas to about 3,000 Afghans through the program, a spokeswoman said. But as many as 5,000 remaining Afghans are now competing for half as many slots.

Wasifi said Gulalai secured permanent resident status in the United States last year and is moving toward citizenship. The allegations against him, Wasifi said, should not stand in his way.

“I blame the U.S. for this,” Wasifi said. “If he was doing wrong to society, it is a shame for you. You appointed him to this position. NDS did not exist before. You created it. If you occupy a country, you are responsible.”

Kevin Sieff in Kabul and Sharifullah Sharaf in Kandahar contributed to this report.