Novak Djokovic scraped past world No. 45 Nicolas Almagro 6-1, 4-6, 7-5 at the Madrid Open and will next face Gilles Simon or Feliciano Lopez in the third round.
The world No. 2 defeated Andy Murray in the final last year but was put through a stern test by Almagro, who almost claimed a shock victory following an action-packed second set.
Djokovic dominated the opening set — breaking his opponent three times to gain a one-set lead after 26 minutes — but dropped the second after Almagro erased two break points.
Almagro soon took a 3-0 lead in the final set, but Djokovic rallied to win the decisive point in the 11th game.
This was Djokovic’s first match since parting company with long-term coach Marian Vajda on Friday, who had worked with the Serbian since 2006.
In Tuesday’s Madrid action, Murray secured his place in the third round with a 6-4, 6-3 win over Marius Copil.
Eighth-seeded Dominic Thiem of Austria joined him by defeating Jared Donaldson of the United States 6-3, 6-4 — while ninth-seeded David Goffin had nine aces on his way to a 7-6 (3), 6-0 win over Florian Mayer.
Australian Bernard Tomic is out after losing 7-5, 4-6, 6-2 against Ryan Harrison of the United States, while Argentina’s Diego Sebastian Schwartzman beat Spaniard Albert Ramos-Vinolas 6-1, 6-3.
Frenchman Benoit Paire secured a second-round date with world No. 3 Stan Wawrinka after beating Pablo Carreno-Busta of Spain 6-3, 6-4.
Luxembourg’s Gilles Muller defeated Tommy Haas of Germany 6-4, 7-6 (7) and will next play fifth seed Canadian Milos Raonic.
Spaniard Nicolas Almagro beat compatriot Tommy Robredo 6-3, 3-6, 6-1 while in Tuesday’s late match, German Alexander Zverev saw off Spaniard Fernando Verdasco 7-5, 6-3.