A cocaine possession charge against New England Patriots safety Patrick Chung will be dropped with the understanding that he will undergo periodic drug testing and perform 40 hours of community service, a prosecutor said Monday.

A grand jury in New Hampshire indicted Chung in August. Belknap County Attorney Andrew Livernois had said members of the Meredith, New Hampshire, police department were called to Chung's home in June and obtained evidence leading to the felony drug charge. Chung pleaded not guilty.

A hearing on Chung's case was scheduled for Tuesday, but was canceled with the release of the agreement.

Livernois said there are several factors that led the state to agree to drop the charge, including that Chung has no criminal record; that he cooperated with police at his home; that the amount of drugs in question was small; and that Chung underwent a substance abuse evaluation that indicated he did not need treatment.

The agreement says Chung will remain on good behavior for two years, submit to monthly drug testing at a lab for a year, then every 90 days for another year. Chung will agree to provide the state with copies of the results and will sign a waiver allowing the state to communicate directly with the lab to verify the results.

Chung's community service will be connected to drug abuse prevention and education and will be completed within 18 months, according to the agreement.

Chung also will agree to waive his rights to a speedy trial and or indictment and agree that if he fails to comply with the requirements, the state has the right to reinstate the charges.

“We are happy with the agreement and ready to move forward," said Chung's lawyer, Corey MacDonald.

Court paperwork last month said both sides were “actively engaged in negotiations regarding a possible resolution of this case." A trial had been scheduled for March.

Chung has been a major contributor on defense to three of the Patriots' six Super Bowl championships.