SEATTLE — A couple of defensive miscues prevented a possible series sweep for Toronto. The Blue Jays still head home atop the wild card chase.

Robinson Cano delivered a sacrifice fly in the 12th inning as the Seattle Mariners avoided a sweep with 2-1 victory over Toronto on Wednesday. The Blue Jays remained a game in front of Baltimore, however, as the Orioles lost to Boston, 5-1.

“Even though we lost today we played a good ball game against one of the best pitchers in the last 10 years,” said Jose Bautista, who sent the game into extra innings with a ninth-inning solo homer. “We’ve just got to continue to play good baseball and keep our heads up. We’re in a good position, we just have to finish strong.”

Knuckleballer R.A. Dickey (10-15), who pitched five scoreless innings in his last start on Friday, came in on the 12th for his first relief appearance after 29 starts.

Guillermo Heredia reached on a two-base throwing error by Blue Jays third baseman Josh Donaldson to open the 12th. Ben Gamel followed with an attempted sacrifice bunt, and first baseman Ryan Goins appeared to have Heredia at third, but the ball popped out of Donaldson’s glove on the tag.

Cano then followed with a run-scoring fly to left, quieting the decidedly pro-Blue Jays crowd, bolstered for the third straight game by thousands of fans from western Canada.

“We were the benefactor of some miscues by them,” Mariners manager Scott Servais said. “That happens, but you’ve still got to finish them off. Robbie had a nice at bat. “

Nick Vincent (4-4) pitched two scoreless innings for the win.

After being blanked on two hits for eight innings, the Blue Jays tied it in the ninth on Bautista’s 19th home run, a one-out solo shot to left off hard-throwing rookie closer Edwin Diaz.

“Anytime you can contribute makes it worthwhile,” Bautista said. “It was a big moment. It was one of the most electric pitchers in the game. I was behind in the count. I was simply trying to put the ball in play. His ball has some run. I just managed to get the head out and I connected.”

Seattle shortstop Mike Freeman prevented the go-ahead run from scoring in the 10th with a diving grab of Kevin Pillar’s one-out liner with a runner on third.

“That’s the game right there, possibly,” Toronto manager John Gibbons said. “If we get the lead and (Roberto) Osuna is still in the game. Helluva play.”

Both starting pitchers were outstanding. Seattle’s Felix Hernandez allowed two hits in seven innings, striking out four and walking three in a 112-pitch outing.

Aaron Sanchez, who allowed six runs in 3 2/3 innings in his last start, gave up a run in the third on a double by Jesus Sucre and a bloop RBI single by Norichika Aoki. Sanchez gave four hits, striking out five and walking three in six innings.

“Both Sanchez and King Felix were good,” Gibbons said. “They plated the go-ahead run on a little gork hit with Aoki and then we came back with the big home run at the end there. We had some chances, but the pitching on both sides was really good.”

SANCHEZ ROLLING

Although he did not get a decision, Sanchez’s 13-2 record is still the best winning percentage (.867) in the majors. He has allowed two earned runs or less in 11 of his last 15 starts and has limited opponents to one earned run or less in 13 starts this season.

UP NEXT:

Blue Jays: After an off day Thursday, Toronto heads into the A.L East gauntlet with two series at home — four games against the Yankees, followed by three against Baltimore, that has huge wild card implications. The Blue Jays then close the season with three games at first-place Boston. Toronto has not announced a starter for the first game of the New York series.

Mariners: Seattle is running out of time. The Mariners followed an eight-game winning streak by losing four out of five. Only one of their three remaining series is against a team ahead of them (Houston) in the wild card race. After a day off, the Mariners open a three-game series at Minnesota. LHP James Paxton (4-7, 3.88 ERA) starts the Friday opener. “The math is not good,” manager Scott Servais said. “We’re going to need some help and some other teams to help us along the way.”