Federer overcame a slow start to win in one hour and 51 minutes but this was the first time in five meetings that he had conceded a set against Istomin.
The second set was relatively comfortable but he had to defend four break points in his first service game of the decider before winning five games on the bounce to move into the next round.
The Argentine, who won the tournament last year, dispatched his opponent in one hour and 19 minutes having taken three of his seven break points.
He has already confirmed his place at the 'Final Showdown' in London and is heading there on a good run of form having reached the final at his past two tournaments in Tokyo and Shanghai.
Richard Gasquet’s hopes of qualifying for the ATP World Tour Finals suffered a blow when he was surprisingly beaten by Michael Llodra in the first round at the Swiss Indoors in Basel.
Gasquet, who is ninth in the Race to London, would have moved ahead of Stanislas Wawrinka into the eighth and final qualification spot but was ousted in an hour and 10 minutes, losing 6-4 6-2 to fellow Frenchman Llodra.
It is Llodra’s first ATP Tour win since Wimbledon in June.
Gasquet has one more chance to reach the season-ending shoot-out in London, which is on home ground at next week’s BNP Parisbas Masters in Bercy.
He has been helped by Wawrinka’s own failure in Basel, while seventh-ranked Tomas Berdych also crashed out on Tuesday.
Llodra, 33, will face compatriot Paul-Henri Mathieu for a place in the quarter-finals.
ATP Basel results
3-Roger Federer (Switzerland) beat Denis Istomin (Uzbekistan) 4-6 6-3 6-2
Ivan Dodig (Croatia) beat 6-Kei Nishikori (Japan) 6-1 6-2
1-Juan Martin Del Potro (Argentina) beat Henri Laaksonen (Switzerland) 6-4 6-4
Vasek Pospisil (Canada) beat Robin Haase (Netherlands) 6-4 6-4
Michael Llodra (France) beat 5-Richard Gasquet (France) 6-4 6-2
8-Grigor Dimitrov (Bulgaria) beat Radek Stepanek (Czech Republic) 6-3 6-3
Paul-Henri Mathieu (France) beat Denis Kudla (U.S.) 6-4 7-5
- Sports & Recreation
- Richard Gasquet
- Michael Llodra
- Henri Laaksonen
- Stanislas Wawrinka