It was during the Ian Macallister storyline. While Ian was looking away, E.J. got free and attacked Ian. When Ian was knocked out, E.J. tied up Ian and called the police. But, E.J. was furious with Stefano for disowning E.J. in the first place and left Stefano there for the police to find as well. He set back to return to Sami.
When he got back to the safe house, he found Rafe there with Sami. Rafe arrested them both and took them into the station. But, the charges were soon dropped. However, the Governor put pressure on E.J. to resign as mayor. So, E.J. turned in his resignation.