Xhaka looked set for the exit after he was stripped of the captaincy in November for reacting angrily to supporters who jeered him when he was substituted during a 2-2 draw with Crystal Palace the previous month.
The 27 year-old was also dropped from the squad for five matches, but he won back his place and, eight months on, is a regular member of the starting line-up again.
Arteta last week praised Xhaka for winning over the fanbase with his displays on the field, but the former Borussia Monchengladbach star admitted he seriously contemplated leaving.
"Everyone knows what happened with me and the fans - or the fans with me. It was not a good time. It was not a nice time," Xhaka said. "But maybe it was the key because I came back stronger than ever, so I learned a lot from this situation. I hope the fans have too.
"I was always saying to myself, but to the fans too, I am a guy that will go 100 per cent each game. The people start to understand me more and more now again.
"I have to be honest, I'm very honest with everyone. I was very, very close to leaving the club. I had, until this moment, had a great, great time in this football club.
"But after this, I was of course a bit down because I did not expect that from the people, from the fans.
"It was never in my mind to leave the club before, but after this happened, of course you think about it."
Switzerland international Xhaka has credited Arteta, who succeeded Unai Emery a little under two months after the incident, for turning around his career in north London.
"When Mikel arrived, I had a very good meeting with him, very good conversations," he said. "Mikel was the guy. He turned me around and gave me a second chance, and he showed me he trusted me and I have tried to give him everything back."
Arsenal takes on Chelsea in the FA Cup final on Sunday (AEST) with Arteta seeking his first piece of silverware in management.
After picking up victories over the likes of Manchester City and Liverpool in the past few weeks, Xhaka has praised the Spaniard for improving the team's fortunes.
"Since Mikel came to this club a lot of things have changed," he said. "He has changed the mentality, the spirit, not only for us players, but in the group.
"Everyone knows exactly what their job is. We have a clear gameplan.
"He prepared us really well against a lot of good teams and yeah, at the moment, it's like we are back with happiness. Coming to training with happiness, we do amazing work."