The diversion deal was approved in Cuyahoga County Common Pleas Court by Judge Eileen Gallagher.
Under the terms, the felony gun charge will be dismissed if the 31-year-old Rogers completes the program, including 40 hours of volunteer service and 10 hours in a gun class. He also has to forfeit the weapon.
Police said Rogers had the semiautomatic handgun in a carry-on bag at Cleveland's Hopkins International Airport in April.
His attorney, Pat D'Angelo, said Rogers received no special treatment and has consistently given the same explanation -- that he had forgotten he had the weapon in the bag.
D'Angelo, commenting outside court while Rogers was processed, said the diversion program might last up to one year and would include helping out at a program aimed at reducing truancy in Cleveland public schools.
Rogers would be subject to a possible felony indictment if he fails to abide by terms of the deal, said Ryan Miday, spokesman for Prosecutor Bill Mason.
The next hurdle for Rogers will be a league review and ruling on a possible suspension.
"We are reviewing it under our policies," NFL spokesman Greg Aiello told The Associated Press in an e-mail after Rogers' court appearance.
D'Angelo said Rogers has a license for the weapon.
"The fact is that athletes are a target, they are victimized in some senses and targets by the criminal element," D'Angelo said after the brief court session. "Some of them feel that they need to have weapons for their own protection. Those are personal judgments that each individual makes."