Novak Djokovic fought to upset compatriot Laslo Djere 2-6, 7-6 (6), 7-6 (4) in the second round of the Serbia Open on Wednesday.
In the first set, Djere generated break-point chances in all four of Djokovic's service games, as the top-ranked Serb battled to find his groove.
Djokovic improved in the second set and won the tiebreaker despite squandering three set points.
Djere was 5-3 ahead in the third set when Djokovic broke back for 4-4 and won the tiebreaker.
Djokovic has lost his last two matches on clay, both against Alejandro Davidovich Fokina at the Monte Carlo Masters.
His first match since losing in the Dubai Tennis Championships quarterfinals in February.
He missed the Australian Open because to his unvaccinated status, which also kept him out of events in the US last month.
Serb Miomir Kecmanovic will meet Djokovic in the quarterfinals after defeating John Millman 6-4, 7-6 (5). On Tuesday, he beat Dominic Thiem.
Djokovic hasn't lost against a compatriot since 2012, when he fell to Janko Tipsarevic in Madrid.
Earlier, Karen Khachanov beat Roman Safiullin in a walkover.
Thiago Monteiro, who beat eighth-seeded Serbian Filip Krajinovic 6-4, 6-1, will play Khachanov.