Spanish police have arrested a worker at a Madrid hotel for posting racist comments on social media against the Moroccan national football team staying at the hotel.

A spokeswoman for Madrid's municipal police said the 27-year-old Spanish national was stopped at the hotel around midnight on Sunday and faced possible charges of hate crimes.

Without giving further details, she said police were sent after hotel managers complained about racist comments posted online.

Spanish media published photos purporting the man posted on his Instagram account, showing a number of members of the Moroccan national team (fourth World Cup Qatar 2022) in the hotel's dining room accompanied by racist comments.

Media reported that the worker later deleted the posts from his Instagram account and apologized before being arrested.

Reports of the posts have sparked outrage in Morocco, which earlier this month joined Spain and Portugal in a joint bid to host the 2030 World Cup.

After Saturday's historic 2-1 friendly win over Brazil in Tangier, Morocco will face Peru in another friendly on Tuesday at Atletico Madrid's Wanda Metropolitano stadium.