WASHINGTON  - The white policeman who shot to death a black teenager in August and avoided criminal prosecution this week has resigned from the police force, his lawyer said Saturday evening.

The resignation comes after almost four months of largely peaceful protests interrupted at times by violent clashes with police, widespread looting and destructive arson in parts of Ferguson, a small town in the US State of Missouri.    Policeman Darren Wilson wrote in his resignation letter that he was “told that my continued employment may put the residents and police officers of the City of Ferguson at risk, which is a circumstance that I cannot allow.”

Wilson, 28 years old, said “for obvious reasons,” he wished to wait until a local county grand jury reached its decision not to indict him on Monday before leaving the police department. His actions on Aug. 9 sparked impassioned nationwide debates over whether Wilson had acted too aggressively in gunning down teenager Michael Brown he had detained during a routine stop that turned violent. Wilson argued in grand jury testimony he acted to protect himself while other witnesses said young Brown had his arms raised before he was shot fatally.

“It was my hope to continue in police work, but the safety of other police officers and the community is of paramount importance to me,” Wilson wrote. “It is my hope that my resignation will allow the community to heal. I would like to thank all of my supporters and fellow officers throughout this process.”

Wilson, 28, shot Brown seven times in August and was placed on administrative leave. Wilson's lawyer said the resignation would be effective immediately.

He and his attorneys have been in negotiations with Ferguson officials about a resignation for weeks. The call to wait until after the grand jury decision was due in part to Wilson's fear of appearing to admit guilt.

"It doesn't even have the same impact that it would have months ago," Patricia Bynes, a Democratic committeewoman for the Ferguson township told the St. Louis Post-Dispatch. "It would have relieved a lot of anger and the pressure in the streets. It's been almost infuriating to get to this point and nothing has changed. There was no accountability and sense of responsibility for what has happened."

In Monday's decision, St. Louis County prosecutor Robert McCulloch said there was "no question" Wilson caused Brown's death, but that "no probable cause exists to file any charge" due to self-defence laws in Missouri.

The announcement sparked waves of international protest and rioting in Ferguson and elsewhere, with dissenters largely decrying institutionalized racism, injustice and a lack of accountability in police ranks.

Wilson said he shot Brown on Aug. 9 after a routine encounter that ended with the teenager trying to take Wilson's gun, as well as assaulting and charging at the officer. Several witnesses have provided conflicting reports, with some confirming Wilson's story and others saying Brown was attempting to surrender. In an interview with ABC, Wilson said he had a "clean conscience" and that he did his job right - comments that have caused much distress to the Brown family.