PITTSBURGH -- It sounds like a free-market success story: a natural gas boom created by drilling company innovation, delivering a vast new source of cheap energy without the government subsidies that solar and wind power demand.

"The free market has worked its magic," the Barnett Shale Energy Education Council, an industry group, claimed over the summer.

The boom happened "away from the greedy grasp of Washington," the American Enterprise Institute, a think tank, wrote in an essay this year.

If bureaucrats "had known this was going on," the essay went on, "surely Washington would have done something to slow it down, tax it more, or stop it altogether."

But those who helped pioneer the technique known as hydraulic fracturing, or fracking, recall a different path. Over three decades, from the shale fields of Texas and Wyoming to the Marcellus in the Northeast, the federal government contributed more than $100 million in research to develop fracking, and billions more in tax breaks.

Now, those industry pioneers say their own effort shows that the government should back research into future sources of energy -- for decades, if need be -- to promote breakthroughs. For all its success now, many people in the oil and gas industry itself once thought shale gas was a waste of time.

"There's no point in mincing words. Some people thought it was stupid," said Dan Steward, a geologist who began working with the Texas natural gas firm Mitchell Energy in 1981. Steward estimated that in the early years, "probably 90 percent of the people" in the firm didn't believe shale gas would be profitable.

"Did I know it was going to work? Hell no," Steward added.

Shale is a rock formation thousands of feet underground. Among its largest U.S. deposits are the Marcellus Shale, under parts of Pennsylvania, New York, Ohio and West Virginia, and the Barnett Shale is in north Texas. Geologists knew shale contained gas, but for more than 100 years the industry focused on shallower reserves. With fracking, large volumes of water, along with sand and hazardous chemicals, are injected underground to break rock apart and free the gas.

In 1975, the Department of Energy began funding research into fracking and horizontal drilling, where wells go down and then sideways for thousands of feet. But it took more than 20 years to perfect the process.

Alex Crawley, a former Department of Energy employee, recalled that some early tests were spectacular - in a bad way.

A test of fracking explosives in Morgantown, W.Va., "blew the pipe out of the well about 600 feet high" in the 1970s, Crawley said. Luckily, no one was killed. He added that a 1975 test well in Wyoming "produced a lot of water."

Steward recalled that Mitchell Energy didn't even cover the cost of fracking on shale tests until the 36th well was drilled.

"There's not a lot of companies that would stay with something this long. Most companies would have given up," he said, crediting founder George Mitchell as a visionary who also got support from the government at key points.

"The government has to be involved, to some degree, with new technologies," Steward said.

Congress passed a huge tax break in 1980 specifically to encourage unconventional natural gas drilling, noted Alex Trembath, a researcher at the Breakthrough Institute, a California nonprofit that supports new ways of thinking about energy and the environment. Trembath said that the Department of Energy invested about $137 million in gas research over three decades, and that the federal tax credit for drillers amounted to $10 billion between 1980 and 2002.

The work wasn't all industry or all government, but both.

One step at a time, the problems of shale drilling were solved. Crawley said Energy Department researchers processed drilling data on supercomputers at a federal lab. Later, technology created to track sounds of Russian submarines during the Cold War was repurposed to help the industry use sound to get a 3-D picture of shale deposits and track exactly where a drill bit was, thousands of feet underground.

"It was a lot of pieces of technology that the industry thought would help them. Some worked out, some didn't," Crawley said.

Renewable energy has had similar fits and starts, plagued by the costs and complexities of developing technology, and markets for it.

The idea that the government can help industry achieve advances that the private sector can't or won't has been a central contention of the presidential election. President Barack Obama's comment this summer that Republicans seized on - "If you've got a business -- you didn't build that" -- was part of broader comments about infrastructure, education and other public spending that indirectly helps businesses.

Both Obama and Republican presidential nominee Mitt Romney tout the benefits of shale gas, but they differ over the government's role in subsidizing energy research. Obama has suggested continued funding for renewable energy but also eliminating billions of dollars in subsidies for oil and gas companies. Romney calls that an unhealthy obsession with green jobs - and has vowed to cut wind power subsidies, yet keep federal support for ethanol.

But the fracking pioneers point out that it's impossible to predict how and when research will pay off.

"It wouldn't be research if you already knew that it was going to be effective," said Crawley.

Steward and others said today's energy challenge is similar to what they faced: a need to find future sources of energy.

"I was concerned about my kids and grandkids. I didn't want my kids sitting out there without energy," Steward said.

Terry Engelder, a Penn State University geologist known for his enthusiastic support for gas drilling, is proud that work he did decades ago helped to lay the groundwork for today's boom. But he said the story of how shale gas went from longshot to head of the pack -- and how long that took -- shows that serious support for renewable energy research makes sense, too.

"These renewables have a huge upside," Engelder said. "In my view, the subsidies are really very appropriate."

Engelder, who's been both praised and criticized for his support of shale gas drilling, said he's sure that research and technology will ultimately deliver innovations that make renewables a major force.

"There's no doubt about it," he said, adding that "the payout might not happen until 2042."

Steward is proud of the shale boom, too, but warned that it won't last forever.

"Don't be fooled by this. We've got to have a replacement" for shale gas, he said.