Michael V. Kostiw withdrew from consideration yesterday as CIA executive director, the third-ranking position at the agency, after it was publicly disclosed that he had resigned from the agency under pressure more than 20 years ago.

"Allegations about my past would be a distraction from the critical work the Director of Central Intelligence needs to focus on," Kostiw said in a statement released by the CIA yesterday. He withdrew, he added, because "I thought it was in the best interests of the agency and all concerned."

CIA Director Porter J. Goss then named Kostiw his senior adviser, abandoning the plan to make him executive director, a position that would have given Kostiw (pronounced COST-ie) responsibilities for day-to-day operations involving budget and personnel, including disciplinary action.

The change came after The Washington Post reported Sunday that, in late 1981, Kostiw was caught shoplifting a $2.13 package of bacon from a supermarket in Langley, according to two former CIA officials familiar with the incident. At the time, Kostiw had been a CIA case officer for 10 years.

In a CIA polygraph test, Kostiw's responses to questions about the incident and his past tours abroad led agency officials to place him on administrative leave for several weeks, according to four sources familiar with the events. Kostiw has told friends he decided to resign during the leave. Agency officials arranged for the misdemeanor shoplifting charge to be dropped and the police record expunged in return for his resignation and agreement to seek counseling, a former official said.

Kostiw, a colonel in an Army Reserve military intelligence unit at the Pentagon, has worked as a lobbyist for ChevronTexaco Corp. and more recently was staff director of the terrorism subcommittee of the House intelligence committee, which Goss chaired.

"Kostiw underwent the security vetting given all employees, and, from a security standpoint, has met the standards required," said a CIA official who asked not to be named.

The Kostiw appointment, announced last Thursday, had quickly drawn criticism inside and outside the CIA. It came from officials who knew about Kostiw's resignation under a cloud and who were already concerned about Goss bringing in four of his Republican staff members. Several former agency officials said they believed that Goss was moving too quickly to make changes amid a presidential election campaign where intelligence is an issue and at a time when Congress is debating the future of the intelligence community.

But Sen. Bob Graham (D-Fla.), former chairman of the Senate intelligence committee and a friend of Goss, said the new CIA director "does not intend to be a caretaker," even if he is there only a short time. "The place has a lot of problems," he said, "and the fact that Porter brought in people he was comfortable with should not be criticized."

A former senior agency official who has remained a frequent consultant on special projects said Goss "was not well served by his staff," which allowed him to proceed with elevating Kostiw. Staff members knew there were CIA employees who were aware of Kostiw's past and "had their long knives out," a reference to their ability to leak the information that led to questioning Kostiw taking a post where "one of the toughest jobs is dealing with disciplinary problems."

"The last thing Goss should have wanted to do was to stir up a cesspool," said Robert Baer, a former CIA case officer. Referring to criticism of the CIA for failing to predict or prevent the Sept. 11, 2001, attacks and for overstating the Iraqi threat, he said, "There was so much unhappiness out there already."

Goss now must find a new nominee for the No. 3 post, in effect the CIA's chief operating officer. In the interim, Martin Petersen, the deputy executive director, will be acting director. Petersen plans to retire next month.