It has been a near love-fest in recent months as Robert Mueller made his way around Capitol Hill for what was to have been the FBI director's last set of annual appearances before congressional budget and oversight committees.
Democrats and Republicans alike gave him a friendly reception that went beyond mere formality into regret over his impending departure.
Now, if all goes according to plan, they'll still have the face they've grown accustomed to at the FBI.
At the president's request, Mueller, a former Marine, has agreed to re-up for a two-year hitch that will take him well into what Barack Obama hopes will be his second term as president. In doing so, Obama and Mueller have taken off the table what could have become a contentious political fight in the Senate over a replacement.
Circumstances combined to make it happen. Some promising candidates didn't want the job. The president made key changes in his national security team. Plunging one more terrorism-fighting agency into a period of transition seemed unwise.
Under the proposed White House scenario, Mueller would serve until the start of September 2013, and then the president elected in 2012 would choose his successor for a 10-year term.
"Given the ongoing threats facing the United States, as well as the leadership transitions at other agencies like the Defense Department and Central Intelligence Agency, I believe continuity and stability at the FBI is critical at this time," Obama said.
Mueller was offered the two-year extension a couple of days ago, said an administration official, speaking on condition of anonymity to discuss the internal process.
The official said Mueller had not been expecting the overture from the president nor had he been looking to stay on.
The move could serve to ratify reforms already made at the FBI and enable Mueller to institutionalize further changes that he has begun _ applying intelligence-driven methods used in preventing terrorist attacks to other FBI crime-fighting missions.
The administration considered other candidates who turned out not to be interested in the job, said another government official. Among them were federal judge Merrick Garland and James Comey, a former deputy attorney general in President George W. Bush's administration.
The hallmark of Mueller's decade-long tenure was no repeat of the Sept. 11, 2001, terrorist attacks, an achievement that both Republicans and Democrats in Congress attribute at least in part to Mueller.
To be sure, the transition under Mueller's leadership was hardly seamless.
The Justice Department's inspector general found that the FBI circumvented the law to obtain thousands of phone call records for terrorism investigations, largely through misuse of national security letters, which allow agents to obtain private records without a judge's approval.
Mueller decided that the FBI wouldn't take part in abusive interrogation techniques of terrorist suspects, but the policy wasn't effectively communicated down the line for nearly two years.
Mueller has much to recommend him to Republicans, as did Comey and a few other candidates for the FBI post.
Mueller, 66, has been appointed to federal law enforcement posts by members of both political parties. He served as U.S. attorney in Boston during the Republican Reagan administration, head of Justice's criminal division during the George H.W. Bush's Republican administration and as U.S. attorney in San Francisco during the Democratic Clinton administration. President George W. Bush nominated him to be FBI director.
At FBI headquarters in Washington, spokesman Paul Bresson said Mueller had no plans to comment publicly on Thursday's events.
The House Judiciary Committee chairman, Republican Rep. Lamar Smith of Texas, backed Obama's move.
"It is important to maintain continuity for our intelligence community during this transition period," Smith said.
In the Senate, the top Republican on the Judiciary Committee, the panel that has jurisdiction over the FBI, offered what amounted to a cautious but favorable response.
"Director Mueller has proven his ability to run the FBI. And we live in extraordinary times. So I'm open to the president's idea," said Sen. Chuck Grassley of Iowa.
But Grassley said it was an unusual move and "somewhat of a risky precedent to set." He called the 10-year limit on an FBI chief's service, set in 1976, "an important safeguard against improper political influence and abuses of the past" and said he wanted to be sure "this is not a more permanent extension that would undermine the purposes of the term limit."
The term limit was set in response to the service of J. Edgar Hoover, who died in 1972, ending a decades-long tenure as FBI director that was marred by abuses of power.
The White House wants Congress to pass a stand-alone bill applying only to Mueller. He would not need to go through confirmation again. An aide said Smith would support such legislation as House Judiciary chairman.
AP White House Correspondent Ben Feller contributed to this report.