The Moroccan tournament lost its two highest-seeded players on the same day as No. 2 Gael Monfils of France withdrew after straining his right ankle in practice.
Hanescu saved five break points and broke for a 3-2 lead in the first set. Anderson, last year's runner-up, dropped serve again at 1-1 in the second.
Hanescu's quarterfinal opponent will be Federico Delbonis of Argentina, who edged Canadian qualifier Filip Peliwo 6-2, 6-7 (5), 6-4.
The sixth-seeded Delbonis, who won the Brazil Open last month, won six straight games to take the first set and lead 2-0 in the second. But Peliwo, the 2012 world junior champion, fought back to force a tiebreaker and leveled at one set apiece. In the third, Delbonis earned the decisive break at 4-4.
Also, Aleksandr Nedovyesov of Kazakhstan and Jiri Vesely of the Czech Republic advanced to the second round.
Vesely defeated Leonardo Mayer of Argentina 6-4, 6-3, and Nedovyesov earned his first victory on the main tour by rallying from a 5-2 deficit in the opening set to stun the seventh-seeded Robin Haase of the Netherlands 7-6 (6), 6-4.
The eighth-seeded Garcia-Lopez beat Mikhail Kukushkin of Kazakhstan 7-6 (5), 7-6 (6) despite making seven double faults.
Named most improved player of the year by the ATP for climbing from 715th to 65th in the rankings last season, Carreno Busta cruised past Tobias Kamke of Germany 6-1, 6-2. The Spaniard broke Kamke twice in each set and did not face any break point.
Montanes saved all four break points he faced in his 6-2, 6-3 win over Kenny de Schepper of France.