WASHINGTON — Stephen R. Kappes, the veteran clandestine officer who came out of retirement in 2006 to lift morale in the Central Intelligence Agency’s troubled ranks, is stepping down as deputy director, the agency announced on Wednesday.

Mr. Kappes, a stern former Marine who over his career served undercover in Moscow, Islamabad, Pakistan, and, in the 1980s, at a secret C.I.A. station in Germany collecting information about Iran, was the first officer from the clandestine service to become the agency’s second-ranking official since the early 1980s.

Leon E. Panetta, the C.I.A. director, said that Michael Morell, who currently runs the agency’s analysis directorate, would take over for Mr. Kappes.

Senior Democrats in Congress applauded Mr. Kappes on Wednesday, crediting him with soothing turmoil at the agency after the intelligence failures preceding the Iraq war and ensuing skirmishes between the agency and the Bush White House.