A federal judge on Tuesday extended for 45 days a temporary restraining order requiring Missouri law enforcement officers to give protesters a reasonable chance to disperse before using teargas.

US district judge Carol Jackson extended the order she issued last month after attorneys for law enforcement agencies and protesters who are suing them said they were in settlement negotiations. The temporary order remains in effect until a settlement is reached or the judge decides whether the order should become permanent.

The two sides “are in good-faith settlement discussions”, attorney Denise Lieberman, who represents the protesters, told the judge. Attorney Michael Hughes, who represents Belmar, said that part of the discussion now centers on creating policies that must be approved by boards and elected officials overseeing the three policing agencies.

Protests have been common in St Louis and the suburb of Ferguson since a white Ferguson police officer, Darren Wilson, shot and killed a black 18-year-old, Michael Brown, following a scuffle. Some of the protests turned unruly, even violent, and police sometimes used teargas and other chemical agents, including during the most violent night of protests after a grand jury decided not to charge the officer, who has since resigned.

Jackson issued the temporary restraining order last month after six protesters filed a lawsuit against the “unified command” established by Governor Jay Nixon to handle security at protests. The command comprises the Missouri state highway patrol captain Ron Johnson, the St Louis County police chief, Jon Belmar, and the St Louis police chief, Sam Dotson.

The temporary restraining order requires police to warn crowds of the impending use of teargas, pepper spray and other chemical agents and provide “reasonable” time for people to disperse before teargas is deployed.

The ruling does not define what is reasonable, leaving that to police discretion. Jackson wrote after last month’s hearing that evidence “establishes that law enforcement officials failed to give the plaintiffs and other protesters any warning that chemical agents would be deployed and, hence, no opportunity to avoid injury”.

Police testified that they did what was necessary during the often dangerous demonstrations.

Jackson’s order also prohibits the use of chemical agents on “non-criminal” protesters “for the purpose of frightening them or punishing them for exercising their constitutional rights”.

Protests against police brutality spread across the country after 24 November, when the St Louis County prosecutor Bob McCulloch announced the grand jury decision not to charge Wilson with a crime. The movement was fueled when another grand jury in New York decided to not indict a white officer in the death of Eric Garner, who died gasping “I can’t breathe” while police were trying to arrest him for allegedly selling loose, untaxed cigarettes.