TORONTO -- Blue Jays outfielder Rajai Davis didn't expect to put in a full day's work when he came on as a defensive replacement in the eighth inning.
Three hours and 10 innings later, he sent his team home happy by delivering the winning hit.
"Considering I got in in the eighth and still played a full game, it's pretty remarkable," Davis said. "I think it's the longest game of my career."
The game lasted 5 hours, 28 minutes, making it 3 hours, 20 minutes longer than Friday's meeting between the teams. Texas equaled a season high with its third straight loss.
Having just stood up for a rare 17th inning stretch, only a small fraction of the crowd of 44,079 remained when Bonifacio hit a one-out single in the 18th and took third with two outs on a wild pickoff throw by Ross Wolf (1-1).
Davis followed with a bouncing single down the third base line, sending the Blue Jays streaming out of their dugout in celebration and ending a game that started under sunny skies but finished with the stadium lights on.
"Relief, a lot of relief," Davis said when asked to describe his emotions. "Thank God, wow."
Wolf (1-1) was Texas' fifth pitcher and worked 6 2/3 innings, almost as many as starter Yu Darvish, who went seven.
"He did an outstanding job," Rangers manager Ron Washington said of Wolf. "That's the prototype for what a long man is supposed to do."
Aaron Loup (3-3), the ninth Toronto pitcher, went one inning for the win. With his bullpen empty, Blue Jays manager John Gibbons said infielder Andy LaRoche would have been called on to pitch if the game had lasted much longer.
Brad Lincoln, who pitched a career-high four scoreless innings for Toronto, was optioned to Triple-A Buffalo after the game. The Blue Jays will call up another reliever on Sunday.
"I kept my team in the game and we won, but the business side of it does kind of stink," Lincoln said of his demotion.
This was the third time in seven games the Blue Jays have gone to extra innings. They lost a 17-inning game at San Diego on May 31 but beat the Padres in 11 innings on June 2.
Adam Lind had four hits as the Blue Jays won their third straight and fourth of five.
The Rangers played 18 innings for the fifth time in their history. They last did it on June 24, 2004, beating Seattle 9-7.
Toronto had played 18 innings once before, beating the Angels on July 28, 2005, when current Blue Jays pitching coach Pete Walker earned the win in a 2-1 victory.
Texas reliever Jason Frasor pitched one inning for the Blue Jays that day, and also worked an inning for the Rangers in this one.
Frasor said while such lengthy games are physically tiring for position players, they're mentally draining for relievers.
"If you're sitting down in the bullpen, it's just the anticipation, the preparation, it just exhausts you," Frasor said. "You're going 'Is this going to be me, is this going to me be?' and then it's not you. You just keep waiting and waiting and it's exhausting."
Toronto led 3-1 heading into the ninth, but the Rangers rallied with two runs off closer Casey Janssen behind a trio of Texas pinch-hitters. Leonys Martin singled, David Murphy walked and A.J. Pierzynski drove in a run with a broken-bat single, then Elvis Andrus tied it with a sacrifice fly.
According to STATS, the last time three Rangers pinch-hitters reached safely was July 15, 1999, against Arizona.
The Blue Jays escaped a bases-loaded, none-out jam in the 10th. After Dustin McGowan struck out Jeff Baker, Juan Perez came on and got Martin to line out to Jose Bautista in right, with Lance Berkman thrown out at home plate to end the inning.
"We know Bautista's got one of the best arms in the game and he did what he had to do," Washington said. "Just hoping he overthrew it or underthrew it or did something, but he made a perfect throw."
The Blue Jays put runners at second and third with two outs in the 13th but Wolf got Mark DeRosa to ground out.
"We kept putting ourselves in position to get something done and it didn't happen," Washington said. "But I'll keep taking us putting ourselves in position. Pretty soon, we'll break through."
Darvish allowed two earned runs and five hits. He walked three and struck out seven.
Blue Jays left-hander Mark Buehrle allowed one run and four hits in seven innings.
Baker homered off Buehrle in the seventh, the first homer off Buehrle since May 6.
Gibbons said RHP Chien-Ming Wang will start for Toronto in Tuesday's game against the Chicago White Sox. Wang opted out of his minor league contract with the New York Yankees on Friday to sign with the Blue Jays. ... Beltre extended his hitting streak to 13 games with a single in the second. ... Blue Jays LHP Darren Oliver (shoulder) pitched one scoreless inning for Class A Dunedin on Friday and is expected to be activated off the 15-day DL Sunday or Monday. ... Toronto designated minor league LHP Evan Crawford for assignment to clear a roster spot for McGowan, who was activated off the 60-day DL before the game. ... Gibbons celebrated his 51st birthday.