Dr. Harold C. Urey, 87, who won the Nobel Prize for chemistry for his discovery of deuterium, or heavy hydrogen, and who made major contributions to the development of the atomic bomb, died Tuesday at his home in La Jolla, Calif. He had a heart ailment.

Dr. Urey's discovery of deuterium in 1931 has been described as one of the most important scientific achievements of modern times. It has had a significant influence on chemistry, physics, medicine and other disciplines. It was a step on the way to the development of the hydrogen bomb.

If Dr. Urey is best known for his work relating to nuclear energy, nuclear physics by no means encompasses all that he did -- nor does pure science encompass all that he thought or cared about. He was interested in the universe and how it was formed, the solar system, and the first stirrings of life. Moreover, he was a forthright speaker on the ethical implications of scientific advances and on such diverse subjects as the value of space exploration and what he regarded as excessive government security regulations in the super-charged atomosphere of anticommunism in the early 1950s.

"I'm afraid there may be no life on Earth at the end of the century," he once said in an interview. He criticized the decision to drop a second atomic bomb on Japan -- its target was Nagasaki. Speaking at the 100th anniversary of the Cooper Union in New York City in 1959, he said "Science is not a substitute for religion." And in a speech at the San Diego campus of the University of California in 1963 he again warned that the scientific revolution had eroded morality and religion.

In a letter to President John F. Kennedy in 1961, he returned to what he viewed as the unnecessary suppression of thought in the name of anticommunism. "I am especially concerned because free and independent thinking is most urgently needed today when most thoughtful approaches to the troublesome problems of this century are required," he wrote. At the time, the government was considering prosecuting American communists who refused to register under the provisions of the McCarran Internal Security Act.

Dr.Urey's metier was the laboratory. "When Harold Urey thinks, he thinks with his whole body and soul," a colleague once said.He was known to corner secretaries with monologues on subjects such as carbonaceous meteorites. "Let me tell you about carbonaceous meteorites," he would say.

According to another story, he once strode into his laboratory, buttonholed an undergraduate assistant, and asked, "Young man, do you know what would happen if two protoasteroids collided?" He then spent an hour expounding on what would happen should such an event occur.

Dr. Urey and a colleague developed a kind of chemical soup in which life itself could be formed. He developed an oxygen thermometer that has enabled scientists to determine climatic temperatures several million years ago through the study of fossils. He was one of six scientists commissioned by the National Aeronautics and Space Administration to study samples of moon rocks brought back by the Apollo manned space missions. He was a consultant on the Viking missions to Mars.

All of these accomplishments came after Dr. Urey already had achieved worldwide fame in the scientific community. The first of these achievements was the discovery, with Drs. George M. Murphy and Ferdinand G. Brickwedde, of deuterium, or heavy hydrogen. What it amounted to was this: heavy water molecules consist of one atom of oxygen and two atoms of hydrogen, or deuterium. It added significantly to knowledge of the ways in which elements can appear in different forms.

At the outset of World War II, he was named the head of one of the three main branches of the Manhattan Project, which developed the atomic bomb. His thinking on the direction that the project should take is said to have had an enormous effect on its success.

In the years after the war, Dr. Urey turned to the peaceful study of geo-chemistry.

Harold Clayton Urey was born at Walkerton, Ind., on April 29, 1893. His parents were Samuel Clayton and Cora Reinoehl Urey. His father, a school teacher and minister of the Brethen Church, died when the boy was 6. His mother later married another clergyman.

Young Urey attended local schools in rural Indiana, was a school teacher himself in Indiana and then Montana, and then went to the Montana State University, where he graduated in 1917 with a degree in zoology and chemistry.

During World War I, he moved to Philadelphia, where he worked as a chemist in the production of war materiels. He said later that this exposure to industrial chemistry had decided him on a career as a researcher in academia. He taught at Montana State until 1921. He then moved to the University of California at Berkeley, where he earned a doctorate in 1923. His major interests at the time were physical and mathematical chemistry.

Dr.Urey spent a year studying with Nils Bohr, the famed nuclear physicist, in Denmark. He spent the years between 1925 and 1929 at Johns Hopkins University in Baltimore. Then he moved to Columbia University in New York City. He was director of the atom bomb project at Columbia during the war.

In 1945, he accepted an appointment at the University of Chicago. In 1958, he was named professor-at-large at the University of California. He remained there for the rest of his life. Although he still maintained an office on university grounds, he had spent much of his time at home in recent years.

Dr. Urey received honorary degrees from a score of universities and the highest honors available in his profession. He received the Medal for Merit from President Harry S. Truman for his work during World War II and the National Medal of Science from President Lyndon B. Johnson for his work in the space program.

Survivors include his wife, Frieda, of La Jolla, four children, Gertrude, Frieda, Mary Alice and John, and 10 grandchildren.