The Obama administration has turned to the Central Intelligence Agency's station chief in Afghanistan to troubleshoot Washington's precarious relationship with President Hamid Karzai, propelling the undercover officer into a critical role normally reserved for diplomats and military chiefs.

The station chief has become a pivotal behind-the-scenes power broker in Kabul, according to U.S. officials as well as current and former diplomats and military figures. In April, when Mr. Karzai lashed out against his Western partners, it was the station chief who was tapped by the White House to calm the Afghan president.

President Karzai with Gen. McChrystal, back left, in the U.S. in May. Getty. Getty Images

The station chief's position became more crucial following the June firing of Gen. Stanley McChrystal, perhaps the only other senior American who had a close relationship with Mr. Karzai, U.S. officials say.

The unusual diplomatic channel is in part a measure of how fragile U.S. relations with the mercurial Afghan president are.

"Karzai needs constant reassurance," said one former colleague of the station chief, and the chief is his "security blanket."

The CIA's prominent role in Afghanistan is fraught, the spy agency having clashed at times with the official diplomatic mission. That has complicated the civilian component of the U.S. military surge.

Ups and Downs Spider has played a significant role in American attempts to improve ties with the Afghan government December 2001 : During an assault on Kandahar, U.S. military accidentally bombs the site of a meeting with Spider, Hamid Karzai, and other Afghan opposition leaders. Three Americans and five Afghans are killed. Mr. Karzai learns shortly after that he has been chosen to head the new interim government

: During an assault on Kandahar, U.S. military accidentally bombs the site of a meeting with Spider, Hamid Karzai, and other Afghan opposition leaders. Three Americans and five Afghans are killed. Mr. Karzai learns shortly after that he has been chosen to head the new interim government March 2002 : CIA paramilitary forces, including Spider, and U.S. military forces launch Operation Anaconda against al Qaeda and the Taliban

: CIA paramilitary forces, including Spider, and U.S. military forces launch Operation Anaconda against al Qaeda and the Taliban January 2005 : Iraq holds its first democratic elections in a half century; U.S. ramp-up there continues as American resources in Afghanistan dwindle.

: Iraq holds its first democratic elections in a half century; U.S. ramp-up there continues as American resources in Afghanistan dwindle. March : U.S. troops' casualty rate in Afghanistan exceeds that of Iraq.

: U.S. troops' casualty rate in Afghanistan exceeds that of Iraq. December 2009 : An informant who was a double agent blows himself up at a remote CIA base near Khost, Afghanistan, killing seven CIA officers and contractors. It is the deadliest attack on the CIA in decades.

: An informant who was a double agent blows himself up at a remote CIA base near Khost, Afghanistan, killing seven CIA officers and contractors. It is the deadliest attack on the CIA in decades. April 2010 : President Karzai unleashes a round of anti-Western invective, complaining of meddling in the August 2009 Afghan elections, and suggests he might be compelled to join the Taliban if he can't take control of election oversight from the U.N.

: President Karzai unleashes a round of anti-Western invective, complaining of meddling in the August 2009 Afghan elections, and suggests he might be compelled to join the Taliban if he can't take control of election oversight from the U.N. May : Mr. Karzai visits Washington, requesting he be accompanied by Spider and Gen. Stanley Mc- Chrystal. He speaks of a 'genuine partnership' with the U.S.

: Mr. Karzai visits Washington, requesting he be accompanied by Spider and Gen. Stanley Mc- Chrystal. He speaks of a 'genuine partnership' with the U.S. August: Mr. Karzai attempts to assert control over two independent anticorruption teams after the arrest of a top aide. He appears to back down, but raises the issue again this week, prompting renewed tensions with the U.S. and Western officials.

In particular, the station chief's role has led to tensions with the U.S. ambassador to Afghanistan, Karl Eikenberry. Officials said the ambassador objected last fall to the return to Kabul of the station chief, who had held the same post earlier in the war. Mr. Eikenberry declined to comment, as did the State Department.

The relationship with Mr. Karzai isn't handled on a daily basis by the station chief; rather, he is called on at critical times. With the administration trying to get all of its leaders in Afghanistan on the same page following Gen. McChrystal's dismissal, others including Mr. Eikenberry and new Allied commander Gen. David Petraeus, as well as senior North Atlantic Treaty Organization officials, also are working to build closer relations with Mr. Karzai.

Some officials worry the U.S. dependence on personal relationships to deal with Kabul is insufficient. It's "becoming a substitute for a political approach to the Afghan government that is really missing," said one former military official.

The Obama administration said that it isn't overly reliant on personal relationships, and that its focus is on establishing broad shared policy goals. "If we have agreement about the strategic direction and the goals we're trying to achieve, we can weather those periods of tension," a senior administration official said.

The CIA said it doesn't discuss individual officers serving overseas. "Our chiefs are chosen for their operational skill, leadership ability, and area knowledge," said George Little, a CIA spokesman.

The station chief, a former Marine in his 50s, is known to some colleagues by his nickname, "Spider." The CIA didn't make him available for an interview.

Besides his relationship with Mr. Karzai, he serves the more traditional role of running CIA operations in Afghanistan, a growing component of the war. The CIA is expanding its presence there by 20% to 25%, in its largest surge since Vietnam. The several hundred officers assigned to Afghanistan outnumber those in Iraq at the height of that war.

The station chief has had a close relationship with his military counterparts. He and Gen. McChrystal forged ties in Iraq and Afghanistan, colleagues say.

The chief met Mr. Karzai before the Afghan war, when U.S. officials were working with Mr. Karzai and other Afghan tribal leaders against the Taliban. Mr. Karzai was in Pakistan, where the chief and his intelligence colleagues were trying to hunt down Osama bin Laden and al Qaeda. After Sept. 11, 2001, as the CIA prepared for the U.S. invasion to rout al Qaeda's Taliban protectors, the chief was assigned the job of working with Mr. Karzai.

"He's spent time with Karzai like no one else has," said a former senior intelligence official.

In the chaos of battle in December 2001, a U.S. military officer accidentally ordered a bomb drop on a meeting between Mr. Karzai and other tribal leaders. The chief leapt on Mr. Karzai to shield him, U.S. and Afghan officials say. He was credited with saving the soon-to-be Afghan president, cementing their relationship.

A senior Afghan official said Mr. Karzai and his staff appreciate the chief's straightforward approach. The official recalled frank early discussions between Afghan and CIA officials about complicated issues such as the need to work with criminals and warlords who wielded power.

The chief was part of a team that launched Operation Anaconda, a 2002 offensive against al Qaeda involving CIA operatives, U.S. Special Forces and Afghan fighters. When Afghan forces came under fire, the chief led them to safety, said former colleagues, earning an agency award for heroism. That operation also bolstered the relationship with Mr. Karzai.

Earlier in life, the chief left the Marines in the 1970s to join the CIA's paramilitary operations unit, known as the Ground Branch of the Special Activities Division. Agency veterans say the unit was active in the 1980s in Central America and helped train Afghans then fighting Soviet forces. He served as a base chief in Bosnia and later spent time in Iraq.

In 2004 he began his first stint as station chief in Kabul, where the focus was hunting down high-value targets. He also began his role of smoothing out rough patches with Afghanistan's president.

An American soldier trains at the Kandahar air base in 2002 Associated Press

"Karzai goes through these moods, and [the station chief] was one of the people who could get through to him," said a former Western military official.

The CIA rotates station chiefs frequently. When Kabul was due for a new one last fall, the leading candidate didn't pass muster with the State Department or Mr. Karzai, people familiar with the matter said. Mr. Karzai pushed for the return of the former station chief, then in the U.S. and considering retirement. The CIA's appointment went through despite the opposition of Ambassador Eikenberry, officials said.

The station chief returned to Afghanistan for an unusual second tour in late 2009 just before a CIA disaster—seven officers killed by a Jordanian informant who turned out to be a double agent and suicide bomber. The chief isn't considered responsible for missteps in handling the agent, say people familiar with the CIA's review of the incident.

Winning Mr. Karzai's cooperation is central to U.S. strategy, especially when controversies arise over issues such as corruption and handling reconciliation with Taliban members. The Afghan president doesn't trust many of the U.S. officials assigned to his nation.

Mr. Karzai unleashed a round of anti-Western invective this spring. He complained of meddling in the Afghan elections and later went so far as to suggest he might be compelled to join the Taliban if he didn't succeed in wresting control of election oversight from the United Nations.

Mr. Eikenberry had barred CIA station chiefs from direct outreach to the Afghan president. But the chief's relationship with Mr. Karzai rose to the attention of the White House, which overruled the ambassador's directive and sought the chief's help to calm Mr. Karzai, people familiar with the matter said.

"What the president really was focused on in April," said the senior administration official, "was: Let's not allow a period of tension to spiral; let's not allow a bad week to derail the fundamental partnership."

By the time Mr. Karzai was set to visit Washington in May, he was again speaking of a "genuine partnership" between his nation and the U.S. Officials said Mr. Karzai asked that two U.S. officials accompany him for the trip—Gen. McChrystal and the station chief.

In recent months, the chief has stepped up cooperation between the CIA and the military in preparation for the planned Kandahar offensive, said a U.S. military official. The agency, Special Forces and the military are swapping intelligence on clan power brokers and Taliban sanctuaries.

The station chief now is expected to play a key role smoothing the way for Gen. Petraeus. The general hasn't served in Afghanistan before, but worked with the station chief when both were in Iraq.

—Julian E. Barnes contributed to this article.