Former Knicks star Charles Oakley agreed Friday morning to a deal to dismiss all charges stemming from a fight at a Knicks game.

In exchange for dismissing his misdemeanor charges of assault and harassment, Oakley will be barred from Madison Square Garden for one year and has to maintain a clean record for six months.

Two months ago, he rejected a similar deal, which meant he would have faced a trial.

Oakley was arrested in February after he shoved Garden security guards who tried to escort him out of the arena.

The former power forward was a pivotal part of the successful Knicks team in the 90s.

But he has had a long-running feud with owner James Dolan, who said Oakley acted hostile prior to the incident.