The world number two needed two hours and 52 minutes to beat the world number one in a grueling and tense match.