The former world number seven is in the hunt for a first title of the season, and defeated Damir Dzumhur 6-2 7-6 (7-3) in his first match on Thursday (AEST).
That victory teed up a last-16 tie with Andujar, who defeated second seed Dan Evans in his first-round match.
The 36-year-old Spaniard is something of a specialist in Marrakech, having won this tournament three times, in 2011, 2012 and 2018.
Young Italian prospect Lorenzo Musetti overcame Andujar's compatriot Carlos Taberner 6-1 6-7 (3-7) 6-3 to become the first player to reach the quarter-finals.
Musetti, who reached the last 16 at last year's French Open and featured at the ATP Next Gen Finals, has had a tough start to 2022, only reaching one other quarter-final so far.
Serbian eighth seed Laslo Djere followed Musetti into the last eight by beating Malek Jaziri 6-4 6-2.
Qualifier Mirza Basic sprung a surprise to overcome Kamil Majchrzak 4-6 6-4 6-1, while Vit Kopriva defeated Bernabe Zapata Miralles in straight sets.
World number 172 Pavel Kotov claimed the scalp of a top-100 player, bouncing back from a first-set bagel to beat Tallon Griekspoor 0-6 6-2 6-2.