MELBOURNE - Roger Federer saved seven match points on his way to an enthralling 6-3 2-6 2-6 7-6(8) 6-3 comeback victory over American world number 100 Tennys Sandgren to reach the semi-finals of the Australian Open on Tuesday.

Federer won the first set but Sandgren rallied to bag the next two against the error-prone Swiss, who received a code violation warning for obscene language and took a lengthy medical timeout during the third set.

Federer's movement seemed restricted but the 20-times Grand Slam winner and six-time champion at Melbourne Park carried on and saved seven match points in the fourth set before winning the tiebreaker to force a decider.

Federer, who got involved in a lengthy argument with Serbian chair umpire Marijana Veljovic during the ill-tempered third set, converted his first matchpoint and will meet either Milos Raonic or Novak Djokovic for a place in Sunday's final.

(Reporting by Sudipto Ganguly; editing by Peter Rutherford) ((sudipto.ganguly@thomsonreuters.com; +91 22 6841 4383; Twitter: @sudipto81;))