SAN FRANCISCO - Given a choice, Marcus Stroman would have preferred to stay in school instead of signing a professional baseball contract following his junior year at Duke University in 2012.

"When I went to Duke University, I chose to graduate from there," Stroman said. "You don't choose a place like Duke to leave early. I was honestly upset when I had to leave. Obviously I couldn't turn down what was being offered, but I was upset because I didn't finish my degree."

Following the Toronto Blue Jays 5-4, 13-inning loss to the San Francisco Giants on Wednesday, Stroman left the team to join a graduation ceremony at Duke this weekend, where he will receive his degree in sociology.

He earned the diploma while rehabbing a torn ACL that limited his 2015 season to a handful of games in September.

"I never thought I'd be thankful for tearing my ACL, but I am because I grew so much as an individual." Stroman said. "I was able to get my degree and I got stronger mentally and physically through it all."

Stroman delivered another solid outing against the Giants. He gave up four runs -- two earned -- on eight hits in his six innings. Stroman walked two and struck out five.

He'd been out of the game for a couple hours before Buster Posey walked with the bases loaded in the 13th inning and the Giants salvaged one win in a three-game series with the Blue Jays.

"It's good to win any way you can at the point," Giants manager Bruce Bochy said. "I'll take the walk."

Brandon Belt was hit by a pitch to open the inning and Denard Span's bunt attempt was mishandled at second. Following a wild pitch, Joe Panik was walked intentionally.

Matt Duffy lined out to first base before Posey saw four straight balls from Ryan Tepera (0-1).

Albert Suarez (1-0) pitched an inning for his first major-league victory.

"We missed some opportunities but our guys battled to even come back and tie it," Blue Jays manager John Gibbons said. "It was just one of those games. You burn through everybody to get to that point. And yeah you never want to lose a game on a walk but that's over with. The guys played a good game out there."

Michael Saunders, who entered the game as a pinch hitter in the seventh, led off the ninth with a home run to straightaway centre.

"Your whole goal is to try to win series, on the road especially," Saunders said. "All season long, you win the first two and you try to get greedy, get the third one. It just didn't go our way."

Josh Donaldson collected four hits, walked and scored a pair of runs for the Blue Jays, who had won five of seven. Edwin Encarnacion, Russell Martin and Justin Smoak also drove in runs.

The Blue Jays scored a pair of runs in the eighth against Cory Gearrin on Martin's sacrifice fly and Smoak's pinch hit single.

TRAINER'S ROOM:

Blue Jays: LHP Aaron Loup (left elbow) threw an inning, about 10 pitches, during an extended spring training game on Tuesday. If he comes out of it OK he will start a rehab assignment on Saturday. ... OF Michael Saunders was not in the starting lineup as a routine day off.

UP NEXT:

Blue Jays: RHP R.A. Dickey (1-4, 5.18 ERA) makes the start for Toronto on Friday in Texas, the opener of a three-game set.