Xhaka joined Arsenal from Borussia Monchengladbach in the summer of 2016 and has won two FA Cups in his time at the club.
Xhaka was involved in an angry confrontation with the club’s fans in a Premier League game against Crystal Palace at the Emirates Stadium in October 2019 when Unai Emery was in charge.
That confrontation led to the former Borussia Monchengladbach midfielder being stripped off the Arsenal captaincy barely a month after he was handed the armband on a full time basis.
Mikel Arteta opted to retain Xhaka when he took over from Emery in December that year and the 29-year-old signed a new contract with the Gunners last year.
"My bags were packed. The passports were out," he told the Players' Tribune.
"I was done with Arsenal. Finished. There was a contract on the table from another club, and all I had to do was sign. I had talked with my wife, Leonita, and we had decided to leave."
"I was shocked. I had never experienced anything like this," he added. "When I got close to the tunnel, I looked up at the fans sitting there -- and this is the part that I will always remember.
"When I close my eyes now, I can still see their faces. I can see their anger. It's not that they don't like me. No, it's different. This is hate. Pure hate. I am really not exaggerating this.That day, I felt very disrespected. The comments were over the line. It felt personal."
He added: "I'm an emotional guy. To feel that level of hatred and disrespect, I wouldn't want it for my worst enemy. Still to this day, if we have lost, I hate walking those last metres to the tunnel, because I still recognise the faces. The same people are sitting there.
"Today I know I made the right decision, absolutely, because I'm still here. But I can't pretend that my relationship with the fans will ever be the same, because that moment will always be in my heart.
"It's like broken glass, you know? You can piece it together, but the cracks will always be there."
Xhaka was linked with a move to AS Roma before the start of this season, with Jose Mourinho keen to add the Switzerland captain to his midfield options in the Italian capital.
Xhaka has made 22 appearances in all competitions for Arsenal this season.