When you think about crime, what do you picture? Probably the dark and scary streets of a crowded city. After all, cop shows always seem to be set in big cities.

But while violent crime is still a problem in urban areas, many of them are in fact safer now than they’ve been in decades. The violent crime rate in rural areas, meanwhile, has climbed above the national average for the first time in 10 years.

In Iowa, the overall violent crime rate rose by 3 percent between 2006 and 2016, but shot up by 50 percent in communities with fewer than 10,000 residents. Violent crime rates have doubled in rural counties in West Virginia over the past couple of decades, while tripling in New Hampshire. “Rural areas, which traditionally have had lower crime rates, have seen dramatic increases in incarceration rates,” says Jacob Kang-Brown, a senior research associate with the Vera Institute of Justice. “We see them now having the highest incarceration rates in the country.”

The explanations for this change are familiar ones. Not all rural areas are poor, but many have lost jobs as factories have closed and farming has become increasingly consolidated. Lack of employment has naturally led to increases in poverty, which is closely associated with crime. The opioid epidemic has hit rural America particularly hard, and methamphetamine remains a major problem in many small towns.

While there’s more rural crime than in the past, there’s also a shortage of law enforcement. Dwindling tax bases mean fewer sheriff’s deputies doing the work. As a result, deputies have to patrol many times the geographic area that a city cop covers on his beat. Last year, voters in Josephine County, Ore., approved a public safety levy, after five previous attempts had failed in as many years. Prior to its passage, there were times when large parts of the county, which has been hit hard by a decline in the timber industry, received no service from the sheriff’s office. Residents would have to wait two to three hours for a response from the state police.

Lack of enforcement, naturally, breeds crime. Criminals, particularly those dealing in drugs, become emboldened or move operations to areas where there’s little danger of detection. Even when perpetrators are caught, there’s not always a place to put them. Before the Josephine County levy passed, the sheriff’s office could afford to fill only half the beds at its jail.

“Whether it’s law enforcement or crime analytics or investigation capacity or behavioral capacity -- on all those fronts, rural areas have less resources available than urban areas,” says Marshall Clement of the Council of State Governments’ Justice Center. It’s good that the problems of rural America have been getting more attention over the past couple of years, because they’re at risk of starting to compound and create new ones.