Philip N. Brownstein, 82, who sought to discourage discrimination among builders and landlords while an administrator with federal housing agencies during the Kennedy and Johnson administrations, died after surgery Sept. 17 at Holy Cross Hospital in Silver Spring. He had lung cancer.

Mr. Brownstein was commissioner of the Federal Housing Administration and was the first assistant secretary for housing at the Department of Housing and Urban Development. He held those positions at a time of social change that included the passage of legislation prohibiting housing discrimination. But the era also brought upheavals such as citywide riots and property damage.

At the FHA from 1963 to early 1969, Mr. Brownstein often gave public speeches advocating justice and fairness in housing. During his first year at the administration, he told a group of Maryland home builders that he hoped they would abide by a voluntary pact to not discriminate against prospective black homeowners. A year before resigning to go into a private law practice, he spoke in favor of the Civil Rights Act of 1968, also known as the Fair Housing Act, which prohibited discrimination where public money was being used to finance housing for low-income families.

At the end of the Johnson administration, he said in a Washington Post article that he hoped his legacy was providing black families with access to loan opportunities. "Let's hope that the days of the 'We will sell to you but we don't think you'll like it out here' are over," he said.

Mr. Brownstein was born in the farming town of Ober, Ind., where his parents were among a handful of Democrats. His father, a shop owner, became ill when he was in high school, and for a few years Mr. Brownstein put aside his law school ambitions. He moved to Washington in 1934 and worked as a truck driver's assistant to pay for his college education.

He took pre-law classes at George Washington University in 1937 and 1938 and received his law degree in 1940 from Columbus University, which later became part of Catholic University. He received a master's degree in law there the following year.

During World War II, he served in the Marine Corps in South Carolina. After the war he joined the Veterans Administration, where he would stay until 1963.

In the late 1950s, he was tapped to head the VA's loan guarantee program, where he helped returning Korean War veterans finance their homes in a largely healthy market. In 1960, he received the agency's highest honor, the Exceptional Service Award, before becoming the chief benefits director the next year.

President John F. Kennedy appointed Mr. Brownstein commissioner of the FHA, and President Lyndon B. Johnson appointed him to his post at HUD soon after the cabinet department was created in November 1965. The housing authority became a part of HUD, but Mr. Brownstein kept his title of commissioner.

During Mr. Brownstein's tenure, he emphasized efficiency and was credited with saving the government millions of dollars. In 1965, he ordered auditors into 100 low-rent projects after it was suspected that families earning more than the subsidy limit were living in apartments set aside for low-income residents.

But he also believed in bigger and better-designed homes for low- or middle-income families. In neighborhoods, he advocated underground utility wiring to keep poles and wires out of sight. "The public in general is becoming increasingly aware of good design and is demanding much more than mere shelter," he wrote in a memo to his field offices in 1965.

From the time he left HUD in early 1969 until 1996, he was a senior partner at the law firm of what became Brownstein, Zeidman & Lore. For the last three years, he was senior counsel at Swidler Berlin Shereff Friedman LLP, focusing on housing and real esate issues.

In the mid-1970s, Mr. Brownstein was on a team that helped New York City through a debilitating financial crisis by working with HUD to back more than $1 billion in existing loans, said Kenneth G. Lore, a Washington lawyer who called Mr. Brownstein his mentor.

After he left the government, Mr. Brownstein served on several housing councils, such as the President's Task Force on Low Income Housing in 1970. From 1969 to 1996, he was a director of the National Housing Conference, and he was a director of the Center for Housing Policy from 1993.

He was named Housing Person of the Year by the National Housing Conference in 1982 and was inducted into the National Association of Home Builders Hall of Fame in 1984.

Mr. Brownstein lived in Mount Rainier from the 1940s to the early 1960s and had lived in the District since 1966.

His son, Michael J. Brownstein, a laboratory chief at the National Institutes of Health, said his father lived briefly in Hyattsville in the early 1960s before realizing that the neighborhood was not racially integrated. "When he heard the landlord was discriminating, he moved into an integrated building in Southwest. He said, 'How in good conscience could I live in a place that practiced discrimination?' "

He is survived by his wife of 61 years, Esther, of the District; his son, of Rockville; three granddaughters; and a sister.

CAPTION: Philip Brownstein served in Kennedy and Johnson administrations.