A Pilsen man charged with a hate crime for defacing the Chicago Loop Synagogue in February has pleaded guilty in a deal with prosecutors that saw him sentenced to the two days he already served in the Cook County Jail.

Stuart Wright, 32, also was ordered to pay restitution of $4,500 and must seek treatment for his diagnosed schizophrenia, according to court records and his lawyer.

“This is not a hate-crime issue,” attorney Michael Byrne told the Chicago Sun-Times on Tuesday. “This is someone who is mentally ill.”

After being caught on security video, Wright was charged with a hate crime and criminal damage to property for smashing a window at the Chicago Loop Synagogue, 16 S. Clark St., and putting swastika stickers on its doors.

Wright — who grew up in a prosperous family in the suburbs, has a master’s degree in accounting and, according to an online profile, has worked as an accountant — was sentenced after changing his plea to guilty on Aug. 9.

“He’s never attended a [white supremacist] meeting,” Byrne said. “He’s not what people might think he is.”

The lawyer said he didn’t know when Wright was diagnosed with schizophrenia, but added, “He’s focused on getting himself well.”

When Wright was arrested Feb. 7, he had Nazi paraphernalia outside his apartment and a pamphlet titled “How To Own A N—–” inside, according to prosecutors.

His arrest came four months after a run-in with police Oct. 17 at a Portillo’s in Elmhurst where he was a regular but, according to employees there, was “a person who gives them a hard time sometimes,” according to police records. The police said Wright stuck the grip of a paintball gun inside an empty Funyuns bag, and some customers and staff were afraid it was a handgun and called police. At one point, he stood and pointed the bag — which contained only the gun’s grip — at a wall, police said.

After being arrested without incident, Wright told the police he hadn’t put the paintball grip in his pocket because “I was just being stupid.” They said he also told them, “I wouldn’t say I was pointing it at people specifically.”

That case remains pending in DuPage County court, according to Byrne.