Suspended Green Bay Packers defensive end Johnny Jolly made a deal with prosecutors Tuesday to avoid trial on a felony drug charge and have the case against him dismissed if he stays out of trouble for the next year.

Jolly was given pretrial diversion, a form of probation that will have the charge against him dismissed in a year if he doesn't break the law and completes other requirements, including 160 hours of community service. Part of the community service will be 10 speaking engagements where he will talk to children and others about the dangers of drug use.

The agreement was reached as Jolly's trial was set to begin this week. He had been facing up to 20 years in prison if convicted.

Jolly was charged with possession of a controlled substance — having at least 200 grams of codeine — after being arrested July 2008 in the parking lot of a Houston club known for drug and gun use. In Jolly's car, police found cups that had a codeine mixture.

State District Judge Mike Anderson accepted the agreement only after lecturing Jolly at length about his responsibilities as a role model to children who look up to him because he is an NFL player.

"This is hopefully a step in the right direction," Anderson told Jolly. "There is just so much good you can do. You can give them an example that will live longer than the longest career."

"Yes sir," responded Jolly, 27, who declined to talk to reporters after the court hearing.

But in the agreement, Jolly said he is aware of his position as a role model.

"I know that I have been given a natural talent and that abusing prescription narcotics has placed my future in jeopardy. I understand that by telling my story to the young people in my community I may prevent them from making the same mistakes," Jolly, who lives in a Houston suburb, said in the agreement.

Anderson had Jolly's mother and brother come up to the judge's bench and told them they would need to help make sure Jolly complies with the agreement.

Prosecutor Todd Keagle said the agreement was the best outcome for the case.

"There will a lot expected of him," Keagle said. "The judge wants to make sure Mr. Jolly understands what he did and that his future can be better and at the same time make the futures of others better."

Along with the community service, Jolly will undergo random drug and alcohol testing. He can't drink alcohol and is barred from bars, nightclubs or other businesses, except for restaurants, that serve alcohol. He also must notify the court when he takes prescription medication.

In June, the NFL suspended Jolly without pay for the upcoming season and perhaps beyond for violating the league's substance abuse policy.

Michelle Beck, Jolly's attorney, said he will deal directly with the NFL about his playing status but declined to give details.

Packers General Manager Ted Thompson on Tuesday declined to speculate on whether Jolly would play for the team after his suspension.

"I was disappointed for him. I like Johnny, and I hope he comes through OK," Thompson said.

Jolly attended high school in Houston and played for Texas A&M University. He was selected by the Packers in the sixth round of the 2006 NFL draft.


Associated Press Sports Writer Chris Jenkins in Green Bay, Wis., contributed to this report.