CASABLANCA, Morocco (AP)—Top-seeded Stanislas Wawrinka of Switzerland needed three sets to defeat qualifier Martin Klizan 6-4, 0-6, 6-4 Thursday and advance to the quarterfinals of the Grand Prix Hassan II.

Victor Hanescu of Romania rallied after losing the first set and beat Jarkko Nieminen 2-6, 6-3, 6-2

Klizan, ranked 212th, won more points than Wawrinka (87-85), but was broken in the 10th game of the opening and final sets.

Wawrinka will play Reda El Amrani of Morocco, who defeated Jan Hajek of the Czech Republic 6-3, 2-6, 6-2. Hanescu will face Richard Gasquet of France, who routed Andrey Golubev 6-1, 6-1 in 45 minutes.

Hanescu reached his first quarterfinal of the year after struggling to cope with Nieminen’s powerful serve. Nieminen won 16 of his first 19 service points.

Hanescu took a 3-0 lead in the second set. Nieminen had chances in the third, wasting five break points.