Sandwiched between its controversial immigration, campaign finance and health-care rulings last month, the Supreme Court issued a little-noticed decision in a Maryland case that gave the green light to states to eliminate the repugnant practice of “prison-based gerrymandering.”

States are now unquestionably free to correct for an ancient flaw in the U.S. Census that counts incarcerated people as residents not of their homes but of the places where their prisons are located. When the prison population was small, the problem was little more than statistical trivia. Today, however, the census counts more than 2 million people as though they were residents of places where they have no community ties.

In a June 25 summary disposition of the case Fletcher v. Lamone , the court upheld Maryland’s landmark 2010 “No Representation Without Population Act,” which does what the Census Bureau would not: count incarcerated people at home for redistricting purposes. Maryland was the first state to recognize that the bureau’s method of counting people in prison resulted in a systematic transfer of political clout that undermined the constitutional principle of “one person, one vote.”

As a 2010 report I presented to the Legislative Black Caucus of Maryland showed, after the 2000 Census Maryland drew one state legislative district that was 18 percent incarcerated. The result was to give every four people who lived near the cluster of prisons in Hagerstown the same representation in Annapolis as five from any other district in the state. While urban and African American communities bore the brunt of the harm, prison-based gerrymandering diluted the votes of residents of communities across the state.

Each level of government experiences this problem differently. Local governments often provide the most dramatic examples. Somerset County, on Maryland’s Eastern Shore, has a sizable African American voting population, but until 2010 it had never elected an African American to county office. In the 1980s, the county settled a Voting Rights Act lawsuit by agreeing to create a district in which African Americans had the numbers to elect a candidate of their choice, but census counts that included the prisons created problems. Padding one district with a largely African American and entirely nonvoting prison population created what we call a “false majority-minority district,” which did not contain enough African American voters to carry an election. Prison-based gerrymandering split the African American voting population between multiple districts, and for decades the county commission remained entirely white.

Maryland’s law now requires the state to determine the home addresses of incarcerated people and perform a simple adjustment to the federal census data prior to redistricting. Lead sponsors Sen. Catherine Pugh (D-Baltimore) and Del. Joseline A. Peña-Melnyk (D-Prince George’s) had large prisons in their districts, took a principled stand for fair redistricting and won bipartisan, urban and rural support for their bill. They made it clear that their bill would not affect funding but would ensure equal representation for all.

Three other states quickly followed suit. New York’s version was successfully implemented for this decade’s redistricting, and Delaware and California’s laws require incarcerated people to be counted at home for the redistricting cycle in 2020. Several other states, from Rhode Island and New Jersey to Illinois to Oregon, are considering similar legislation.

Of course, the best place to improve on federal Census Bureau data is at the bureau itself. The Supreme Court’s ruling will accelerate states’ demand for the tools and data needed to end prison-based gerrymandering. Thankfully, census policy is not set in stone. As the country has changed, the rules for counting many groups has necessarily evolved as well. As former Census Bureau director Kenneth Prewitt has explained: “Current census residency rules ignore the reality of prison life. . . . Counting people in prison as residents of their home communities offers a more accurate picture of the size, demographics and needs of our nation’s communities.”

The next census is years away, but the planning for it is already underway. The bureau should figure out how to count incarcerated people at home in the next census, or all states should follow Maryland’s lead and, with the blessing of the Supreme Court, improve the census themselves.

The writer is executive director of the Prison Policy Initiative.