Del Potro successfully ended Federer's unbeaten start to 2018, winning the match 6-4 6-7 (8-10) 7-6 (7-2).
Federer's previous best start to a season was in 2006, when he won 16 matches in a row until losing to Rafael Nadal in the final of the Dubai Open.
Federer admits he is expecting another gruelling war of attrition against Del Potro, who is on a 10-match winning streak.
Del Potro took control of the opening set with a break in the 20-time major champion's third service game.
Down a set and trailing 4-2 in the second, Federer had to claw his way back from the brink of defeat.
Del Potro was enjoying himself against the Canadian, and broke again in game three of the second after two blistering winners, one from each wing. Del Potro saved the first two, on his own serve.
After the match, Federer admitted that he "should have lost". Their most memorable matchup was the 2009 U.S. Open final, which included two tiebreaks that Del Potro won as he wore Federer down in the fifth set and won his only Grand Slam event.
"The people are screaming when I miss a first serve!" a filthy Del Potro yelled at Murphy in the second set as he demanded the official keep the crowd quiet.
On the win against Raonic, Del Potro said: "I think I was lucky in both sets".
Android 8.0 Oreo rolling out to Galaxy Note8
The highlight of the Galaxy Note 8 is its S-Pen stylus which differentiates the device from the Galaxy S8 and S8+. The figures on display, however, don't mention what variant of the Galaxy S9+ or Note 8, we're dealing with here.
"It's a wonderful atmosphere, we love coming here, so thank you for everything you've given the tournament and to me".
Prior to the BNP Paribas Open final, Federer had won five of the pair's last six matches going back to 2013.
"Most importantly, Juan Martin, well done, you deserved it, you were the better player", he said.
Del Potro is hardly a feel-good story anymore, the underdog scrapping his way back from three wrist surgeries between 2014 and 2015 that caused him to contemplate retirement.
The 29-year-old said he is looking forward to playing the in-form Federer, who holds an 18-6 advantage in head-to-head matchups.
Federer leads their head-to-head record 18-6 and beat the tall Argentine thrice in their four meetings a year ago.
Two of the calmest players on tour were anything but as they fought out a tense decider in California while raucous fans got on both stars' nerves. Like I said, I'm happy for Juan Martin.
"But it means a lot play against Roger".
The match was played under hard conditions with winds swirling around the main stadium.
Beating Federer has never been easy - del Potro had succeeded just six times in 24 previous attempts - and the nailbiting final lasted nearly three hours with both players taking occasional issue with the chair umpire.