Occasional marijuana use doesn't affect lung health, according to a 20-year study released Tuesday in the Journal of the American Medical Association.

The researchers from the University of California, San Francisco, and the University of Alabama at Birmingham analyzed lung function tests from more than 5,000 men and women in four U.S. cities who said they smoked marijuana or tobacco or both. They measured lung volume and airflow -- the amount of air a person can blow out in one second.

They found what they expected with tobacco use -- consistent loss of lung function with increasing exposure. However, they were surprised to find a different result for marijuana.

“With up to seven joint-years of life-time exposure (e.g., one joint/day for seven years or one joint/week for 49 years), we found no evidence that increasing exposure to marijuana adversely affects pulmonary function,” the researchers write.

Low lifetime exposure to marijuana was associated with a slight improvement in lung function. However, the amount of gain was minimal, co-author Stefan Kertesz said in a story in The Atlantic.

"Healthy adults can blow out three to four liters of air in one second. The amount of gain, on average, from marijuana is small, 50 ccs or roughly a fifth of a can of coke. So it's not something that would be noticeable," he said.

The researchers said one factor behind the different effects on the lungs is the difference in consumption of marijuana and tobacco.

"Tobacco users typically smoke 10 to 20 cigarettes/day, and some smoke much more than that," lead author Mark Pletcher said in a statement. "Marijuana users, on average, smoke only two to three times a month, so the typical exposure to marijuana is much lower than for tobacco."

“And marijuana is one where a lot of people dabble with it in their late teens and 20s, and some people continue with relatively low levels for a long period of time,” Kertesz added.

The study's finding suggested that heavy use of marijuana harmed the lungs, but the researchers said there too few heavy users in the study to make a reliable estimate.

E-mail Sue Thoms: sthoms@grpress.com