Robert M. McNamara Jr., 68, a government and corporate lawyer who served as general counsel of the CIA and Peace Corps, died Jan. 10 at Sibley Memorial Hospital in Washington. He had cancer.

A friend, William Penniman, confirmed the death.

Mr. McNamara retired in July from the for-profit education company Career Education Corp., where he had been senior vice president for government relations. From 2001 to 2004, he was a partner in the Washington office of the law firm Manatt, Phelps & Phillips and managing director of the firm’s international consulting subsidiary.

Mr. McNamara — who was not related to former defense secretary Robert S. McNamara — ended his three-decade federal career as CIA general counsel from 1997 to 2001, serving under Director George J. Tenet during the Clinton administration.

He had earlier served as assistant general counsel for enforcement at the Treasury Department, deputy director of enforcement at the Commodity Futures Trading Commission, general counsel of the Peace Corps and legislative counsel for the Senate Judiciary Committee.

Robert Martin McNamara Jr. was a native of Columbus, Ohio. He received a bachelor’s degree from John Carroll University in Ohio in 1968. After two years with the Peace Corps in Micronesia, he entered Georgetown University law school.

He graduated from Georgetown University law school in 1973, and then worked on Capitol Hill as assistant majority counsel of the Senate Watergate Committee. He was recruited to the committee by one of his former professors, Samuel Dash, who was the committee’s chief counsel.

Mr. McNamara spent many years as an adjunct professor at Georgetown’s law school.

He was the recipient of the CIA’s Distinguished Intelligence Medal, the CIA Director’s Award and the Treasury Department’s Distinguished Service Award. He served on advisory boards and task forces on intelligence and security.

In retirement, Mr. McNamara was a volunteer at Sibley Memorial Hospital and as a child mentor in the Court Appointed Special Advocates program in Montgomery County. He was a Bethesda resident.

Survivors include his wife of 31 years, Patricia Devenney McNamara of Bethesda; two children, Brendan McNamara of Washington and Caitlin McNamara of Bethesda; a brother; and two sisters.

— Adam Bernstein