WASHINGTON — In a major setback to D.C. leaders, Congress retained a provision preventing the city from commercializing marijuana in the omnibus spending package it unveiled Wednesday, dashing the city’s hopes for pushing through legislation to regulate recreational pot.

The spending package also retained a long-standing rider – a type of restriction on how funds can be used – that would ban the District from using local funds to subsidize abortions for low-income women.

With Democrats in narrow control of Congress, D.C. had been preparing legislation to legalize the sale of recreational marijuana, in case that rider were removed. Senate Democrats had removed the marijuana and abortion riders in a budget proposal last year. Congress can restrict how the District uses local funds because it has oversight of D.C. laws, since it is not a state.

But congressional Republicans insisted during negotiations that they would not support a budget that eliminated “legacy riders.” Republican votes would be needed to clear the filibuster in the evenly divided Senate, giving the party leverage.

D.C. leaders were not pleased.

D.C. Council Chairman Phil Mendelson, who has introduced D.C. legislation to legalize marijuana sales, said Congress “has set up for the District, with this rider, a public safety problem. I can’t be strong enough about this.”

D.C. legalized possession of marijuana with a voter-approved law in 2014 – but, since then, a rider from Rep. Andy Harris, R-Md., has prevented the city from legalizing regulating and taxing the sale of recreational pot. That holdup has created a bizarre situation in which people can possess the drug in the District but not buy it, while enabling illegal activity and depriving the city of lucrative tax revenue that could come from regulating legal sales.

“We have a burgeoning illegal, unregulated market that’s surrounded with criminal activity,” Mendelson said. “The market’s not only illegal, but there is criminal activity such as robberies around these black-market pop-ups, and we can’t do anything about it because we cannot regulate the sale of distribution of marijuana because of this rider.”

D.C. Mayor Muriel Bowser’s chief of staff, John Falcicchio, said on Twitter that the illegal sales “shouldn’t be called the black market. It should be called the Harris market.”

The D.C. Council held its first hearing last November on Mendelson’s bill to legalize marijuana sales. The bill would also expunge certain marijuana arrests and convictions; steer business licenses for starting recreational dispensaries to residents who have lived in low-income areas or to those with past marijuana-related convictions; and steer a portion of the tax revenue from sales to aid low-income neighborhoods and homeless services and boost economic development.

A coalition of 50 advocacy groups, spanning drug policy, civil liberties, criminal justice, business and more, wrote to congressional leadership asking appropriators to keep the Harris rider out of the budget. In their letter, the groups noted that D.C. is one of 19 jurisdictions nationwide allowing adults to access marijuana – but, because it is not a state, it hasn’t been able to make its own decisions about how to regulate it.

“It is imperative to both public health, public safety, and for Congress’ support of the District’s right to home rule that the removal of the Harris rider is maintained,” the groups wrote.

The Washington Post’s Michael Brice-Saddler contributed to this report.

Comments are not available on this story.