Ziyech confirmed that he was pre-selected for Halilhodzic's squad but grew tired by the team's leadership spreading "misinformation" about him and his commitment to his country.
Ziyech posted on Instagram: "I love my country and playing for the Moroccan national football team has been the honour of my lifetime.
"So it is with great sadness that I must announce that although the FRMF President today confirmed that I will be pre-selected for the team, I won't be returning to play for Morocco.
"I'm sorry to disappoint the fans, this was not an easy decision to make, but sadly I feel I have no other choice.
"Despite giving my all to the team over the past six years and supporting them my entire life, the leadership continue to release misinformation about me and my commitment to my country.
"Their actions have made it impossible for me to continue to be part of the team.
"I learned the news about the pre-selection at the same time as everyone else, so I'm releasing this statement to ensure that you hear the truth directly from me.
"Thank you to everyone who has supported me, I wish the team nothing but the best for the future. My focus as a player is at my club Chelsea FC."