It looked at first as if it would be a good clean win for the Blue Jays over Yu Darvish and the visiting Texas Rangers in front of an announced near-capacity crowd of 44,079 at the Rogers Centre.

What it turned into was the longest game in franchise history, a marathon 18-inning contest decided after five hours and 28 minutes when Rajai Davis singled down the left-field line to score Emilio Bonifacio from third for a 4-3 victory.

The Jays had caught a huge break one play earlier — as is so often the case in extra-inning games — when Rangers reliever Ross Wolf made an errant pickoff attempt at first, allowing Bonifacio to advance all the way to third.

The Jays had the potential winning run in scoring position three times in extra innings — including an opportunity in the 15th with runners at the corners and none out — but failed to convert until Davis came up with two out in the 18th.

The Jays needed all of their relievers on Saturday afternoon, with Dustin McGowan, Juan Perez, Neil Wagner, Brett Cecil, Brad Lincoln and Aaron Loup combining to throw nine shutout innings after Casey Janssen’s first blown save of the season.