Samuel Riley Pierce Jr., 78, a noted lawyer and public official whose career was marred at its end by an investigation of mismanagement and influence-peddling during his service as secretary of Housing and Urban Development in the Reagan administration, died Oct. 31 at Holy Cross Hospital of complications from a stroke.

Although he was never charged with a crime, Mr. Pierce said in 1995 that his "own conduct failed to set the proper standard" during the eight years he headed HUD. The statement followed extensive negotiations with Arlin M. Adams, the special counsel who conducted a five-year investigation.

Mr. Pierce was the only African American to serve in President Ronald Reagan's Cabinet, and the only Cabinet member to remain in office throughout Reagan's two terms.

He maintained that any abuses that occurred were the fault of subordinates who acted without his knowledge. Adams obtained convictions of 16 former HUD officials.

The scandal arose in 1989 after an internal HUD audit of a program designed to provide rent subsidies to developers to improve housing for the poor. A congressional committee took up the matter and in 1990 issued a report alleging that millions of dollars had been distributed to Republican consultants at a time when funding for the program was being cut from $26 billion to $8 billion. As secretary, Mr. Pierce agreed to the spending reductions.

Republicans who asked Mr. Pierce to make them part of the program included Edward M. Brooke, a former senator from Massachusetts, and James G. Watt, secretary of the interior under Reagan.

Appearing before the House investigating committee, Mr. Pierce said that "over time, people asked me to get all kinds of benefits."

"In eight years, I'll bet you hundreds, perhaps thousands, of people--Republicans and Democrats, governors, mayors, congressmen, senators, developers, contractors and so on--would ask me for something," he said.

He insisted that he had always directed subordinates to take action on such requests purely on their merits.

The investigation ended a career that had been marked by an almost unbroken string of successes.

Mr. Pierce was born in Glen Cove, N.Y. His father was a successful businessman, and his mother was the former Hettie Armstrong. After high school, where he was the salutatorian of his class, he went to Cornell University, where he was elected to Phi Beta Kappa and was a star on the track and football teams.

During World War II, he served in the Army and was assigned to criminal investigations in North Africa and Italy.

In 1949, he graduated from Cornell's law school and was admitted to the New York Bar Association. His first job was as an assistant district attorney in New York City. In 1952, he received a master's degree in tax law from New York University's law school.

In the early 1950s, he was an assistant U.S. attorney in New York. In 1955, he moved to Washington and became assistant to the undersecretary of labor. In 1956 and 1957, he was counsel to the antitrust subcommittee of the House Judiciary Committee.

In 1957 and 1958, he was a Ford Foundation fellow at Yale University's law school.

In 1959 and 1960, he received interim appointments to vacancies on the old Court of General Sessions from New York Gov. Nelson A. Rockefeller (R), but he failed to win election to full 14-year terms in New York City. Observers noted that he had the disadvantage of running as a Republican in an overwhelmingly Democratic city.

In 1964, Mr. Pierce helped found Freedom National Bank in Harlem.

Mr. Pierce represented the Rev. Martin Luther King Jr. as a member of the legal team that won the landmark U.S. Supreme Court case New York Times v. Sullivan, which grew out of the Times' coverage of the civil rights movement. The case established important principles in libel law.

As general counsel of the Treasury Department from 1970 until 1973, he supervised a staff of 900 lawyers. He played a leading role in negotiating terms under which the government bailed out the Lockheed aircraft corporation.

Before becoming head of HUD, he was a partner in the New York law firm of Battle, Fowler, Jaffin, Pierce & Kheel. He was said to be the first black partner in a major New York law firm.

Over the years, Mr. Pierce served as a director of a number of corporations, including Prudential Insurance, General Electric and International Paper. He was a trustee of the Rand Corp. and a governor of the American Stock Exchange. He also was a trustee of Howard University, Mount Holyoke College and Hampton Institute.

Mr. Pierce's service at HUD began with an unintended slight from Reagan. At a reception for municipal leaders in 1981, the president failed to recognize him and greeted him as "Mr. Mayor." The gaffe was widely reported and caused considerable embarrassment to Mr. Pierce, according to associates.

When he left the Cabinet, Mr. Pierce remained in Washington and was a consultant until his death.

Survivors include his wife of 52 years, Dr. Barbara Wright Pierce of New York; a daughter, Victoria W. Pierce of Silver Spring; and a brother, Dr. Chester M. Pierce of Boston.