After years of halting steps, top prosecutors and elected officials in New York City on Tuesday made a sudden dash toward ending many of the marijuana arrests that for decades have entangled mostly black and Hispanic people.

The plans, still unwritten and under negotiation, will rise or fall on the type of conduct involving marijuana that officials decide should still warrant arrest and prosecution. The changes appear likely to create a patchwork of prosecution policies across the city’s five boroughs, and are unlikely to restrict police officers from stopping and searching people on suspicion of possessing a drug that is now legal in a number of states.

But with the city now conceding a wide racial gap in arrests and with the Police Department’s rationale for that gap collapsing under scrutiny, the plans represent a striking shift that could lead in some parts of the city to people generally facing no criminal penalties for smoking marijuana.

Mayor Bill de Blasio, who suggested only weeks ago that city policy would hold fast until New York State legalized the drug, directed the Police Department on Tuesday to have a plan within 30 days to “end unnecessary arrests.”