WASHINGTON — Oil and gas companies injected hundreds of millions of gallons of hazardous or carcinogenic chemicals into wells in more than 13 states from 2005 to 2009, according to an investigation by Congressional Democrats.

The chemicals were used by companies during a drilling process known as hydraulic fracturing, or hydrofracking, which involves the high-pressure injection of a mixture of water, sand and chemical additives into rock formations deep underground. The process, which is being used to tap into large reserves of natural gas around the country, opens fissures in the rock to stimulate the release of oil and gas.

Hydrofracking has attracted increased scrutiny from lawmakers and environmentalists in part because of fears that the chemicals used during the process can contaminate underground sources of drinking water.

“Questions about the safety of hydraulic fracturing persist, which are compounded by the secrecy surrounding the chemicals used in hydraulic fracturing fluids,” said the report, which was written by Representatives Henry A. Waxman of California, Edward J. Markey of Massachusetts and Diana DeGette of Colorado.