BERKELEY, Calif. — Charles Hard Townes, the co-inventor of the laser and a Nobel laureate in physics, has died. He was 99.

Officials at the University of California, Berkeley, where Townes was a professor emeritus, said he had been in poor health before he died Tuesday on the way to an Oakland hospital.

Townes did most of the work that would make him one of three scientists to share the 1964 Nobel Prize in physics for research leading to the creation of the laser while he was a faculty member at Columbia University.

His research applied the microwave technique used in wartime radar research to the study of spectroscopy, the dispersion of an object’s light into its component colors. He envisioned that would provide a new window into the structure of atoms and molecules and a new basis for controlling electromagnetic waves.

Later in his career, Townes earned praise and scorn for a series of speeches investigating the similarities between science and religion.

Townes joined the Columbia University faculty in 1948, and three years later had his inspiration for the laser’s predecessor, the maser, while sitting on a park bench in Washington, waiting for a restaurant to open for breakfast.

Scientists were stumped about ways to make waves shorter, but in the tranquil morning hours the solution suddenly appeared to Townes, a moment he famously compared to a religious revelation.

Townes scribbled a theory on scrap paper about using microwave energy to stoke molecules to move fast enough to create a shorter wave.

In 1954, that theory was realized when Townes and his students developed the maser (microwave amplification by stimulated emission of radiation). Townes and his brother-in-law, the late Stanford professor Arthur L. Schawlow, jointly published a theory in 1958 on the feasibility of optical and infrared masers, or lasers.In 1966, he published an article entitled “The Convergence of Science and Religion” in the IBM journal THINK.

He was born on July 28, 1915, in Greenville, S.C., to Baptist parents who embraced an open-minded interpretation of theology.He married his wife, Frances Hildreth Townes, in 1941, and during World War II designed radar bombing systems for Bell Laboratories.

Townes lived in Berkeley and is survived by his wife and four daughters, Linda Rosenwein, Ellen Townes-Anderson, Carla Kessler, and Holly Townes.