Belgrade - World number one Novak Djokovic battled for almost five hours to defeat Mikhail Kukushkin 6-7 (6/8), 7-6 (7/3), 4-6, 6-3, 6-2 to level the Davis Cup World Group first round tie between Serbia and Kazakhstan on Sunday.
Djokovic hit 19 aces and 37 winners but committed 94 unforced errors in a four hour 57-minute epic win over world number 79 Kukushkin.
That levelled the tie at 2-2 with Serbia's Viktor Troicki, the world number 23, to face Aleksandr Nedovyesov in the decisive rubber later Sunday.
Djokovic gave his country a 1-0 lead on Friday by easily defeating Nedovyesov, the world number 200.
But, in the second singles, Kukushkin fought back to level 1-1 by beating Troicki 7-5, 6-2, 6-4.
In Saturday's doubles, Nedovyesov and Andrey Golubev defeated Djokovic and Nenad Zimonjic 6-3, 7-6 (7/3), 7-5.
That was Djokovic's first loss in Davis Cup in five years.
Serbia won the Davis Cup in 2010, led by Djokovic.