Stanley F. Reed, a retired associate justice of the U.S. Supreme Court who was noted both for his support of New Deal legislation and for his restrained views on civil liberties and related issues, died Wednesday at the Hilaire Nursing Home in Huntington, N.Y., following a stroke. He was 95.

Mr. Reed took his seat on the court on Jan. 31, 1938. He was the second person appointed to that bench by president Franklin D. Roosevelt, the first having been the late justice Hugo L. Black. On Jan. 31, 1957, Mr. Reed announced his retirement, saying that he was stepping down "simply because I'm 72 years old. The strain of close concentration on important cases no longer seems wise."

His career on the high court thus spanned the closing years of one of its most active periods in the nation's life and the early years of another time in which it brought about far-reaching changes on the American scene.

In the 1930s, the crucial questions before the court concerned the constitutionality of laws designed to increase federal regulation of the economy and thereby alleviate the hardships of the Great Depression. The court's refusal to uphold much of this early New Deal legislation prompted Roosevelt to try to "pack" the court with new members favorable to his programs. Although the court-packing plan failed, the justices already had begun to find many of the new laws constitutional by the time Mr. Reed joined the court.

Indeed, Mr. Reed played a role in persuading them to do so. From 1935 to 1938, he was solicitor general of the United States and had the duty of arguing the government's side of cases before the court. Among his victories was the case in which the National Labor Relations Act was ruled constitutional in 1936.

With the outbreak of World War II, the Depression ended and for the next decade the court's role became less visible -- and less controversial. Some of its most publicized actions in those years were on requirements by some school boards that students salute the flag or recite prayers. The court ruled such policies unconstitutional. Mr. Reed dissented.

Another group of cases concerned requirements of loyalty oaths, an aspect of the virulent anticommunism that characterized the postwar years, and the refusal by some witneses to answer questions posed by members of congressional committees. Mr. Reed held that the loyalty oaths and the questions from Congress were proper. Again he was in the court minority.

While his positions drew sharp criticism from liberal commentators, Mr. Reed held to them throughout his career.

On other questions he drew the wrath of consevatives. He wrote the opinion in which the court outlawed primary elections in which only whites could vote. He also wrote the opinion in which segregated seating was outlawed on buses traveling across state lines.

These opinions were in line with the court's first great excursion into the national life and consciousness since the Depression: its historic rulings on civil rights, most notably with the school desegregation decision in 1954. Mr. Reed concurred in that decision and with other civil rights rulings. He retired before the court began its controversial restatement of the criminal law, taking care to guard the rights of defendants.

In one of his rare speeches, Mr. Reed stated his judicial philosophy in these words in 1950:

"The Supreme Court of the United States . . . has its authority only from the four corners of [the Constitution] and cannot properly go outside that organic law to condemn legislation merely because its members may disagree with the wisdom or the desirability of its enactment. . . . There is . . . the danger . . . the court or some of its members will permit their attitudes toward issues to sway their conclusions as to constitutionality . . .

"It is incumbent upon our judiciary to restrain any inclination to exert those powers to achieve particular results merely because they are agreeable to the judges' conception of proper economic or social arrangements."

When Mr. Reed's nomination to the court was announced, Harlan Fiske Stone, then chief justice of the United States, wrote, "I am quite happy about Reed's appointment. He is honest, straightforward, and a hard worker, and I think a good lawyer."

At Mr. Reed's death, Warren E. Burger, the present chief justice, said:

"A moderate in all things and the exemplar of a true 18th century gentleman, Justice Reed wrote with clarity and firmness and his hallmark was civility at all times, even in the most controversial cases coming before the court . . . His life and career make him a model to all who must deal with the great controversies of our time."

Burger also noted that Mr. Reed sat on various federal appellate courts and the U.S. Court of Claims as a parttime judge for many years after his retirement from the Supreme Court. This is an option open to all retired federal judges. Mr. Reed maintained a home in Washington until last year, when he moved to the nursing home in Huntington.

Stanley Forman Reed was born in Mason County, Ky., on Dec. 31, 1884. His father was John A. Reed, a prosperous physician, and his mother was the former Frances Forman.

He earned a bachelor's degree from Kentucky Wesleyan College and another from Yale University. He studied law at the University of Virginia and Columbia University and then spent a year at the University of Paris. But he took a law degree from none of these schools. In accordance with a common practice of those times, he read law in the office of a lawyer and was admitted to the Kentucky Bar in 1910. He was the last member of the Supreme Court to be educated in this way.

He went into a private practice in Maysville, Ky. His clients included the Chesapeake & Ohio Railroad and the Burely Tobacco Growers' Association. He also served in the Kentucky legislature. The growers' association was a cooperative for marketing the crops of its members and it led to Mr. Reed's career in Washington.

In 1929, president Herbert Hoover named him general counsel of the Federal Farm Board. This was federal cooperative, in effect, which marketed U.S. agricultural surpluses abroad.

From the end of 1932 until 1935, Mr. Reed was the general counsel of the Reconstruction Finance Corp. This was a federal agency set up to provide financial aid to banks, businesses and agricultural enterprises that had been hard hit by the Depression. In 1935, Roosevelt appointed him solicitor general.

Three years later, Mr. Reed became the 69th justice in the history of the Supreme Court. During his career there, he wrote 339 opinions, of which 231 were for the court, 20 in concurrence, and 88 in dessent. He lived longer than any of the 101 judges who have sat on the court.

Mr. Reed received honorary degrees from Kentucky Wesleyan, Yale, Columbia, the University of Kentucky and the University of Louisville.

Survivors include his wife, the former Winifred Elgin, of Huntington; two sons, John A. and Stanley F. Jr., both of New York City, and three grandchildren.