William O. Douglas, a fierce defender of civil rights, civil liberties and the right of dissent during his 36 years as a U.S. Supreme Court justice, died early yesterday at Walter Reed Army Medical Center after being hospitalized for a month with pneumonia and progressive lung and kidney failure. He was 81.

Appointed by President Franklin D. Roosevelt in 1939 as one of a new breed of liberal justices, Douglas served on the high court for 36 years -- longer than anyone else -- but was forced to retire Nov. 12, 1975, because of the crippling effects of a stroke suffered the previous New Year's Eve.

Douglas' wife, Cathleen, and other family members were with him at the time of his death.

The funeral will be at 11 a.m. Wednesday at the National Presbyterian Church, 4101 Nebraska Ave. NW, with burial at Arlington National Cemetery at 1 p.m. The body may be viewed at the church from noon Tuesday until the funeral.

Members of the high court will act as honorary pallbearers, with eulogies to be given by Chief Justice Warren E. Burger, former justice Abe Fortas and others.

President Carter ordered flags on federal buildings flown at half-mast until after the burial and said, "William O. Douglas was a lion-like defender of individual liberty. He was fiercely certain that the simple words of the Bill of Rights were meant to protect the humblest citizen from an exercise of arbitrary power, and he never deviated from that passionate conviction.

"Individual freedom in this country had no mightier champion.

"Justice Douglas loved the outdoors with the same intensity he brought to his love of political liberty. He defended the natural and the constitutional heritage of his country with equal vigor."

Chairman Edward M. Kennedy (D.-Mass.) of the Senate Judiciary Committee called Douglas "one of the greatest jurists ever to sit on the Supreme Court."

Burger said yesterday that Douglas' "impact on the law in his time is matched by only a small company of the 100 other justices who have served since 1790." Burger called Douglas "a particularly forceful champion of the individual."

Justice William J. Brennan Jr., who often found himself, Douglas and one or two others united in lonely dissent on libertarian issues, called Douglas "surely a justice to rank with the very great of the court's history" praising his "brilliant, imaginative probing."

Justice Potter Stewart, with whom Douglas often disagreed, said, "I shall remember Bill Douglas best for the rugged originality of his thought and the fierce independence of his spirit."

Justice Thurgood Marshall, a frequent ally, said, "Every ounce of his boundless energy was directed to the protection of personal rights."

Statements of admiration also came from the other justices, including those who had clashed with him, and from civil rights organizations.

A native of Minnesota who was reared in Washington State, Douglas was a renowned outdoorsman, naturalist and conservationist who at one time hiked along the 184-mile-long Chesapeake and Ohio Canal to campaign for its designation as a national historic park, which was eventually named after him.

Married four times and severely criticized by conservatives for his liberal views, he was the object of impeachment attempts -- one led by then-representative Gerald R. Ford -- which came to nothing. But he was also frequently mentioned in the two decades after World War II as a possible Democratic presidential nominee.

Throughout his judicial career, Douglas was frequently a dissenter when the court failed to enlarge individual liberties.

He backed civil rights and civil liberties decisions of the Warren Court, which broadened the rights of prisoners and suspects, struck down segregation laws and policies, widened the scope of freedom of speech, and nailed down the requirement of one-man one-vote.

Later, in the more conservative Burger Court, Douglas was often a champion dissenter. In his 36 years on the court he dissented more than 500 times. All told, he wrote 1,279 opinions, according to court records.

According to the recent book "The Brethren," Douglas tried to maintain an active role on the court even in retirement -- seeking, for example, to have a tenth chair set up in the courtroom so that he could continue to participate. His colleagues blocked his attempt.