Officials at the University of California, Berkeley, where Townes was a professor emeritus who only last year stopped going to campus every day, said he had been in poor health before he died Tuesday on the way to an Oakland hospital.
Townes was a faculty member at Columbia University when he 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. The others were Russian physicists Aleksandr M. Prokhorov and Nicolai G. Basov.
Townes' research, the basis of which he often said came to him like a religious revelation, 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. His insights eventually led to the first laser and eventual applications for medicine, astronomy and telecommunications.
"Charlie Townes had an enormous impact on physics and society in general," Steven Boggs, the chairman of the physics department at Berkeley, said. "Our department and all of UC Berkeley benefited from his wisdom and vision for nearly half a century. His overwhelming dedication to science and personal commitment to remaining active in research was inspirational to all of us."
PHOTOS: 2015 famous deaths
A devoted member of the United Church of Christ, Townes earned praise and raised eyebrows later in his career with a series of speeches and essays investigating the similarities between science and religion.
"Science tries to understand what our universe is like and how it works, including us humans," Townes wrote in 2005 upon being awarded the Templeton Prize for his contributions in "affirming life's spiritual dimension."
"My own view is that, while science and religion may seem different, they have many similarities, and should interact and enlighten each other," he wrote.
Born on July 28, 1915, in Greenville, S.C., to Baptist parents who embraced an open-minded interpretation of theology, Townes found his calling during his sophomore year at Furman University and went on to earn a master's degree from Duke University in physics and a doctorate at the California Institute of Technology.
He married his wife, Frances Hildreth Townes, in 1941, and during World War II designed radar bombing systems for Bell Laboratories.
Three years after he joined the Columbia faculty in 1948, Townes 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).
Demonstrating that masers could be made to operate in optical and infrared capacities, 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.
A laser controls the way that energized atoms release photons, or light particles. Today, they perform tasks ranging from cutting metal to vision correction and tattoo removal, but its inventors say they didn't foresee any of that.
"I realized there would be many applications for the laser," Townes told Esquire magazine in 2001, "but it never occurred to me we'd get such power from it."
Others built the first working lasers, but Townes shared the Nobel Prize in 1964 with two Russians for his work leading to its creation.
"I feel that very rarely have I done any work in my life," he told Esquire. "I have a good time. I'm exploring. I'm playing a game, solving puzzles, and having fun, and for some reason people have been willing to pay me for it. Officially, I was supposed to retire years ago, but retire from what? Why stop having a good time?"
Townes was named a full professor at Columbia in 1950 and later served as chairman of the university's physics department.
He was appointed provost and physics professor at the Massachusetts Institute of Technology in 1961, and in 1967 he joined the faculty at the University of California.
In 1966, he published an article entitled "The Convergence of Science and Religion" in the IBM journal THINK.
The difference between science and religion "are largely superficial," he wrote, "the two become almost indistinguishable if we look at the real nature of each."
In an era when many scientists steadfastly avoided ties to religion, the views expressed in the piece were seen as blasphemy by people in both communities. Over the years, he wrote and spoke often on the subject, and in 2005, he won the Templeton Prize for Progress Toward Research or Discoveries about Spiritual Realities.
The award, billed as the world's richest religion prize, was worth more than $1.5 million, and past recipients have included Mother Teresa.
"Many people don't realize that science basically involves assumptions and faith. But nothing is absolutely proved," Townes said at the time. "Wonderful things in both science and religion come from our efforts based on observations, thoughtful assumptions, faith and logic."
Townes lived in Berkeley and is survived by his wife and four daughters, Linda Rosenwein, Ellen Townes-Anderson, Carla Kessler, and Holly Townes.