Cia's Second In Command Turning In Trench Coat

WASHINGTON — CIA Deputy Director John McMahon, a survivor of scandals that racked the agency for years, has announced he is ending his 34-year career in the intelligence business.

The White House announced Tuesday that President Reagan had ''received and accepted with regret'' a resignation letter in which McMahon, 56, announced plans to leave the CIA as of March 29.

''The president praised his 34 years of work in the intelligence community and expressed his deep appreciation for his contribution to the nation,'' White House spokesman Larry Speakes said.

McMahon, whose CIA career included a stint as chief overseer of spy operations, was one of the few agency officials who had the confidence of Congress and the White House during the congressional inquiries that placed the agency in an uncomfortable spotlight in the 1970s.

Named by Reagan to succeed him was Robert Gates, 42, a 20-year veteran who has spent almost his entire career as an intelligence analyst.

Since 1982 Gates has headed the intelligence directorate at the CIA, which produces foreign intelligence analyses from assessments of data collected through covert means and events abroad.

McMahon, deputy director of the CIA since June 1982, told Reagan he had discussed his plans with CIA Director William Casey and said, ''I have reached the stage where I should move on.''

''I do that with the satisfaction and confidence that U.S. intelligence has never been better thanks to the resources you have placed into our intelligence effort and the strong support you have given our intelligence programs,'' McMahon said.

A CIA spokeswoman said McMahon had no specific plans beyond his departure. ''He's like a lot of people who have had a long career and want to retire,'' she said.

Under Reagan, the CIA has enjoyed hefty budget increases in an era of fiscal austerity. Reagan has alleged that purges of the agency in the Carter administration weakened the CIA and U.S. intelligence capabilities.

''He has brought wisdom, energy and leadership to our activities that has provided our country with an intelligence capability second to none,'' McMahon said. ''While I must admit that I do not leave the intelligence world without mixed emotions, it is gratifying to leave it on a high and in such good hands.''

Gates joined the CIA in 1966 and has served as a special assistant to the director for strategic arms limitations.