LOS ANGELES — Want to keep your family safe? Then raise your kids in the city.

Researchers found people living in densely populated urban areas in the United States are 20 percent less likely to die from a serious injury than people who live in rural parts of the country.

So much for fresh air and open spaces.

“The findings definitely surprised me,” said lead researcher Sage Myers, who teaches at the University of Pennsylvania and practices emergency room medicine at the Children’s Hospital of Philadelphia.

“Homicide rates are higher in cities, and people think of those more emotional and sensationalized dangers, but the risk of motor vehicle accidents and machinery accidents is much higher in rural areas,” she said.

In a study published in the peer reviewed Annals of Emergency Room Medicine on Tuesday, Myers and her team analyzed all of the nearly 1.3 million recorded deaths in the United States from injuries between 1999 and 2006. These included deaths from car accidents, poisoning, firearms, drowning, falls, suffocation, cuts and heavy machinery, among others.

Deaths from terrorist attacks, the vast majority of which occurred on Sept. 11, 2001, were ignored in the study.

The top three killers across the entire nation — in both rural and urban areas — are drug-related poisonings, shootings and car accidents, Meyers said. And of those three, car accidents are by far the biggest killer.

The researchers found that an equal share of people in rural and urban areas die as a result of gun wounds, and that a lower percentage of people in rural areas die of poisoning like drug overdoses compared with people in urban areas.

But they also found that the risk of dying in a car accident is nearly twice as high for people living in the most rural areas than it is in the most urban areas — so statistically, at least, the city is a safer place to live than the deep country.