The surprise announcement this week by William Webster that he plans to resign as director of the Central Intelligence Agency, perhaps as early as May 26, represents a real loss to the Bush administration.

In his four years at the helm of the CIA, as in his earlier nine years as head of the FBI, Webster has been the right man in the right places at the right time.Webster took over the FBI and later the CIA at crucial moments when those agencies were wracked with turmoil, the objects of public concern and high-profile targets of political critics.

He calmed emotions, set tough standards, took the agencies out of the political spotlight, and put them back on the track to run as quiet but competent organizations.

In the process, he won the respect of leaders of both political parties in Congress by building bridges, never overstepping his limits, and keeping congressional oversight committees fully informed. Webster is praised as a "deep believer in the rule of law" who complied "not only with the letter of the law, but with the spirit of the law as well."

Because he was a former federal judge, that style of Webster's is perhaps not surprising. It also reflects his own personality, which is described as "calm" and "serene" and tending toward "judicious caution."

In the circumstances in which he served, those qualities served him particularly well. By their very nature as intelligence-gathering agencies, neither the CIA nor the FBI should be on the political stage. Their work is best carried out in the background by professionals who leave the political decisionmaking up to elected officials.

Although a registered Republican, Webster was appointed by Democratic President Jimmy Carter to head the FBI in 1978 when it was still struggling to overcome an image tarnished by political dirty tricks, public disclosure of some of the legendary J. Edgar Hoover's misdeeds, and several other illegal activities. Carter said he wanted the best man for the job, regardless of politics.

In his nine years with the FBI, Webster managed to restore the reputation of the famed agency. When the CIA was in turmoil after the Iran-Contra scandal and its image damaged by secret dealings of its director, William Casey, it seemed logical for President Reagan to call on Webster to ride to the rescue once more. In his subdued, quiet fashion, he did what he was asked to do.

At age 67, Webster wants to "pursue other avenues." He leaves behind a healthy CIA. The nation owes Webster a debt of gratitude for his calm, no-nonsense leadership of two of the country's most important organizations.