Spain exited the Olympics this evening without finding the net from their three group matches.
The latest nation to shut them out was Morocco, who held firm despite having to cope with sustained Spanish pressure after the restart at Old Trafford.
Nordin Amrabat was Morocco's brightest player and he had a couple efforts at goal. However, Manchester United goalkeeper David de Gea was equal to the Galatasaray midfielder's shots.
Spain's better chances at goal arrived during the second half. Atletico Madrid striker Adrian Lopez had the best of them, but he chipped wide of the target from six yards out with 65 minutes played.
Chelsea midfielder Oriol Romeu also went close for the Spanish, but his headed effort was cleared off the line.
The draw means that Morocco finish third in Group D, while Spain end up bottom.