A Philadelphia schoolteacher has been sentenced to five years in a state prison in connection with a drug deal last September outside Cheltenham High School in Wyncote.

Paul Stein, 35, who was a physics teacher at George Washington Carver Magnet School, drew a mandatory five years from a Montgomery County Court judge; Stein was illegally carrying a loaded 9mm handgun when he sold a pound of marijuana to undercover officers Sept. 8.

He pleaded guilty to two counts of possession with intent to deliver the drugs.

Judge Thomas C. Branca recommended that Stein be incarcerated at the State Correctional Institution at Chester, Delaware County, where those convicted of drug offenses can seek counseling.

"This is a man who set himself out as an example to children," said Kevin Steele, first assistant district attorney, who prosecuted the case. "He was a teacher and he made a decision to deal drugs within 100 feet of Cheltenham High School in Montgomery County, and he brought a gun to that delivery."

At the time of the drug bust, Stein's students mounted a "Free Paul Stein" campaign for him on the Internet, and online chatter portrayed him as a very effective teacher.