 Federer and Agassi played each other 11 times between 1998 and 2005 before Agassi 's retirement in 2006 . Federer led the rivalry 8 – 3 . This was Federer 's most significant rivalry with an all @-@ time great player of the previous generation . They first met in only the third tournament of Federer 's career at the 1998 Swiss Indoors in Federer 's hometown , with Agassi prevailing over the 17 @-@ year @-@ old . Agassi also defeated Federer at the 2001 US Open and the finals of the Miami Masters in 2002 . Federer began to turn the tide at the Masters Cup in 2003 , when he defeated Agassi in both the round robin and the final . They played a memorable quarterfinal match at the 2004 US Open that spanned over 2 days with Federer eventually prevailing in 5 sets . At the 2005 Dubai Championships , Federer and Agassi attracted worldwide headlines with a publicity stunt that saw the two tennis legends play on a <unk> almost 700 feet above sea level at the world famous seven @-@ star luxury hotel the Burj al @-@ Arab . Their final match was at one of the most prestigious platforms in the sport , when they played in the finals of the 2005 US Open . Federer was victorious in four sets , claiming the 6th Grand Slam tournament of his career and denying Agassi his 9th . 
