MIAMI — With the bases loaded, two outs, and the game scoreless in the bottom of the ninth, Henderson Alvarez stood in the Miami Marlins’ on-deck circle, bat in hand, hoping to complete his no-hitter.
Alvarez had blanked the Detroit Tigers for nine innings — and briefly, mistakenly thought he had pitched a no-hitter. But the Marlins needed a run for him to achieve the feat.
‘‘I was nervous and anxious,’’ he said. ‘‘I started praying, ‘Please give us a run.’ I was hoping for a wild pitch.’’
That’s exactly how Miami scored. Giancarlo Stanton crossed the plate standing up when a breaking ball skipped to the backstop, and Alvarez had his no-hitter, beating the Tigers on the final day of the regular season Sunday, 1-0.
Alvarez — who had been due to hit next — took off his batting helmet and began to celebrate with teammates in the on-deck circle.
Later, the 23-year-old Venezuelan went into the stands to hug his pregnant wife.
Of the 282 no-hitters in history, it was the only one to end on a wild pitch, according to STATS. And it was the first walkoff complete-game no-hitter since Virgil Trucks of the Tigers threw one May 15, 1952, against Washington.
Alvarez needed the run for his no-hitter to be official, because a MLB ruling in 1991 said only complete games of nine or more innings with no hits count as no-hitters.
Alvarez got it when Luke Putkonen’s first pitch to Greg Dobbs was low and inside, eluding catcher Brayan Pena.
Alvarez (5-6) struck out four, walked one, and hit a batter. When he closed out the top of the ninth, he pumped one fist and then both, thinking the game was over.
He remained confused until he got to the dugout and a teammate explained the situation to him.
‘‘With the emotion and nerves, I didn’t realize we hadn’t scored a run yet,’’ a sheepish Alvarez said.
The righthander pitched the third no-hitter this year, joining the Reds’ Homer Bailey and the Giants’ Tim Lincecum.
It was the fourth season-ending no-hitter , and first since Mike Witt of the Angels threw a perfect game at Texas in 1984.
With the Tigers’ playoff slot settled, they rested four starters and had pulled three others by the seventh inning. Miguel Cabrera, who won his third consecutive batting title, never stepped to the plate.