Thought Morocco took the lead 15 minutes after the beginning of the match, Spain recouped itself five minutes later.
Morocco was bottom of their group, after failing to gain any points following their first two matches at the tournament, first losing to Iran 1-0 and then to reigning European champions Portugal by the same scoreline.
Spain made it 1-1 at the 19th minute, but Morocco took the lead back at the 81st minute making it 2-1, which didn't last long with Morocco equalizing the score.
Spain midfielder Isko was named man of the match after Morocco were held to a 2-2 draw. Spain will now take on Russia at Moscow’s Luzhniki Stadium on Sunday.
The 2018 FIFA World Cup kicked off on June 14 and will continue until July 15, with the matches being played in 11 cities across Russia.