Washington — Sen. Cory Booker on Wednesday introduced legislation that would legalize marijuana, expunge federal marijuana convictions, and penalize states with racially disparate arrest or incarceration rates for marijuana-related crimes — a series of changes aimed at undoing some of the harm the nation’s decadeslong war on drugs has inflicted on poor and minority communities.

Like legislation introduced two years ago by Sen. Bernie Sanders, I-Vt., the bill from Booker, a New Jersey Democrat, would remove marijuana from the federal Controlled Substances Act. This would remove marijuana from the purview of the federal Drug Enforcement Administration and allow states to set their own policies.

But Booker’s bill would go considerably further. It would withhold some criminal justice funding from states that haven’t legalized marijuana if they exhibit racially disproportionate arrest or incarceration rates. In effect, this would apply to every state in which marijuana is not currently legal: a 2013 ACLU report found that nationwide, blacks were nearly 4 times as likely to be arrested on marijuana charges as whites, despite similar rates of use of the drug.

Booker’s legislation effectively would encourage states to legalize marijuana in order to avoid these penalties. Funds withheld from states would be put toward a federal “Community Reinvestment Fund” that would receive a separate $500 million in appropriations annually. The fund would be used to “establish a grant program to reinvest in communities most affected by the war on drugs.” It would cover job training programs, criminal re-entry assistance, public libraries and community centers, youth programs, and health education.

The bill also would create a process for expunging federal marijuana convictions and resentencing individuals currently serving time for federal marijuana offenses.

The bill stands little chance of passing in a Republican-controlled Congress. But Booker is frequently mentioned as a leading contender for the Democratic presidential nomination in 2020. His full-throated embrace of legalization is a signal that the party continues to evolve on an issue that’s overwhelmingly popular with Democratic voters.