For the third year in a row, the number of people in state and federal prisons in the US has declined, the Justice Department’s Bureau of Justice Statistics reported Thursday. At the end of 2012, there were 1,571,013 prisoners in America, down 1.7% (or 27,770 inmates) from the previous year. Breaking down the numbers (see below), that means that somewhere north of 330,000 people were imprisoned for drug crimes in the US at the end of last year.

The three-year decline in prison populations marks a shift in incarceration policies in the states in recent years. For three decades, prison populations had been increasingly steadily. In 1978, there were 307,276 prisoners; by 2009, that number had climbed to 1,615,487 at the end of 2009.

Nine states (in numerical order: California, Texas, North Carolina, Colorado, Arkansas, New York, Florida, Virginia, and Maryland) saw decreases of more than a thousand inmates. But California alone accounted for more than half the national decline; its prison population decreased by 15,035 as its prison crisis-driven Public Safety Realignment policy diverted “nonserious, nonsex, nonviolent offenders” to local jails instead.

But federal prisoner populations are still increasing, albeit at a slower rate than over the past decade. The number of federal prisoners increased 0.7% (or 1,453 inmates) during 2012, driven largely by immigration law enforcement and, to a lesser degree, drug law enforcement.

In the states, 53% of prisoners were doing time for violent offenses (murder, rape, robbery, assault), while 18% were in for property offenses, 17% for drug offenses, and 11% for public order offenses (weapons violations, drunk driving, commercialized vice). But among the nearly 220,000 federal prisoners, a whopping 47% were doing time for drug offenses. With roughly 229,000 state prisoners doing time for drug offenses and roughly 103,000 federal drug prisoners, more than 330,000 are imprisoned for drugs in the US (not counting people doing jail time).

In terms of race, blacks accounted for 38% of all prisoners, whites for 35%, and Hispanics 21%. More black inmates were sentenced for drug offenses than white or Hispanic inmates.

The decline in the number of people behind bars also translates to a decline in the incarceration rate to 480 per 100,000 population. This marks the fifth year in a row that the incarceration rate has declined.

The states with the highest incarceration rates are all in the Deep South or the near Southwest: Louisiana (893 per 100,000 state residents), Mississippi (717 per 100,000 state residents), Alabama (650 per 100,000 state residents), Oklahoma (648 per 100,000 state residents), and Texas (601 per 100,000 state residents).