"I was scoring ... somehow, some way," Gyorko said, smiling.
Gyorko raced home to end this marathon of a game -- 4 hours 58 minutes, in case you were wondering -- after Jesus Guzman lined a single into center field off Blue Jays pitcher Todd Redmond (0-1).
Gyorko, who was 3-for-7 at the plate, reached on a one-out single in the 17th inning and then advanced to second base when pitcher Clayton Richard -- who was scheduled to start Saturday's game -- bunted him over to second base. Guzman followed with a single that ended the game.
"You work so hard in a lot of ways ... to win it, is a great win," Padres manager Bud Black said. "That was a big hit for Guzie."
This was the longest game the Padres (25-29) had played since June 7, 2009.
Richard entered the game in the 16th inning and was the eighth pitcher of the game for the Padres. That the team used him, Black said, was not always a slam dunk.
"We talked about it ... using a position player or a pitcher," Black said. "But we wanted to win the game. We took his [Richard] start out of the equation and went for the win."
Richard (1-5) tossed two scoreless innings. Left-hander Robbie Erlin will start Saturday's game. He will fly to San Diego on Saturday from Tucson, where he had been pitching for the Padres' Triple-A affiliate.
In all, the two teams combined to use 42 players. A total of 493 pitches were thrown, many by relievers from both bullpens.
The Padres had seven relievers combine to allow five hits over 11 2/3 innings with 10 strikeouts and no walks.
The Padres, who entered the game having surrendered the second-most home runs (63) in the National League, fell behind early as Colby Rasmus connected for a two-run shot to center field off Padres starter Jason Marquis in the second inning.
Two innings later, Edwin Encarnacion nearly perforated the brick facade of the Western Metal Supply Co. building with a solo home run as the Jays took a 3-0 lead, which appeared moderately safe as Toronto's starting pitcher, Chad Jenkins, opened the game with three hitless innings.
But Jenkins got into trouble in the fifth, as he hit Carlos Quentin in the left forearm with a pitch to start the inning. Yonder Alonso then dumped a soft single into center field. Jenkins got Yasmani Grandal on a slider for the first out but left a fastball up to Gyorko.
Gyorko, who found his groove at the plate with a .333 average in May, drove in two runs with a double to the gap in right-center field. He smartly advanced to third when the throw went home. But he did not stay there long, as he scored when catcher J.P. Arencibia threw the ball away.
Marquis scuffled to start the sixth inning, allowing three to reach base. With the bases loaded and one out, Black went to the bullpen for Tyson Ross. It took Ross all of three pitches to get the final two outs, as he got Melky Cabrera to bounce into a tough 3-2-3 double play to end the inning.
Marquis allowed three runs on seven hits with four walks and six strikeouts in 5 1/3 innings.
In a blink of an eye, the 3-0 lead the Blue Jays built with two big swings evaporated into a tie game with Gyorko's hit and the subsequent throwing error.
The Padres had their chances thereafter, as they put two runners on with no outs to start the sixth. But one out later, Quentin bounced into an inning-ending double play. In the seventh inning, Alonso was hit on the right hand by a pitch to start the inning, but they still could not chase home a run.
Alonso, who was in obvious pain afterward, stayed in the game and played defense the following inning but was replaced at first base by Kyle Blanks. Alonso received a diagnosis of a contusion of the hang. He is considered day to day.
While Marquis struggled at times Friday, the relievers who followed him fared considerably better, as Ross got the big double-play ball and Dale Thayer and Luke Gregerson combined for five strikeouts over three scoreless innings, important innings because Huston Street was unavailable because of a sore left calf.
Padres relievers retired 17 consecutive batters before Adam Lind singled to begin the 13th inning off Nick Vincent, the seventh pitcher Black called upon. Vincent tossed three scoreless innings.