Updated

Even in the early innings, Henderson Alvarez knew he had a no-hitter going. The score, however, left him confused.

When Alvarez struck out Matt Tuiasosopo to end the top of the ninth, he thought he had completed a no-hitter for a 1-0 Miami Marlins victory. Alvarez raised a fist and then both arms in celebration.

Oops. The score was 0-0.

That changed a short time later, when Giancarlo Stanton scored on a bases-loaded, two-out wild pitch. The Marlins had a 1-0 win, and Alvarez had his no-hitter on the final day of the regular season Sunday.

"I knew I was pitching a no-hitter early in the game, that it was a gem," Alvarez said. "I really wanted to finish it."

He celebrated in the on-deck circle, where he was standing when Stanton crossed the plate because he was due to hit next. After being mobbed by teammates, the 23-year-old Venezuelan went into the stands to hug his pregnant wife and kiss her belly.

Of the 282 no-hitters in history, it was the only one to end on a wild pitch, STATS said. And it was the first walk-off complete-game no-hitter since Virgil Trucks of the Tigers threw one on May 15, 1952, against Washington.

"That's the beauty of baseball," Marlins manager Mike Redmond said. "You never know what you're going to see. On the last day of the season, what a treat."

Alvarez needed the run for his no-hitter to be official, because a Major League Baseball ruling in 1991 said only complete games of nine or more innings with no hits count as no-hitters.

Alvarez (5-6) struck out four, walked one and hit a batter. With the Tigers' playoff slot decided as AL Central champions, they played with a patchwork lineup, but they didn't begrudge Alvarez or the Marlins for celebrating.

"It was exciting for them and it was very special for him, so you have to be happy for that, no matter what side you're on," Tigers infielder Hernan Perez said. "Any time a guy gets a no-hitter there should be a big celebration, and it's great for the Marlins to end the season that way."

Alvarez capped a dismal season for the Marlins, who had the worst record in the NL at 62-100. He pitched the third no-hitter this year, joining Homer Bailey of Cincinnati and Tim Lincecum of San Francisco.

Detroit 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.

The Tigers' postseason assignment was determined before the weekend, and they'll start a division series at Oakland on Friday. Prior to the game, Tigers manager Jim Leyland acknowledged he and his players were already thinking ahead.

"I want to play this game, I want to win this game, but I want to get this over with and get home," Leyland said. "Guys are anxious. They want to get to the postseason."

Alvarez made the Tigers' eagerness work to his advantage.

"He had a lot of movement, and he fed off the fact they were swinging aggressively," Redmond said. The game lasted only 2 hours, 6 minutes.

Twice the Tigers were robbed of hits by fine defensive plays, including Alvarez's leaping snare of Don Kelly's one-hopper before he threw to first for the second out in the ninth.

Alvarez struck out Tuiasosopo on a 3-2 pitch — his 99th — to end the top of the ninth, and was puzzled when his teammates didn't start celebrating a victory.

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. "At the time I thought the game was 1-0. I threw my hands up and thought the game was over."

Then he needed the help from the Marlins' offense, which is last in the majors in runs.

Stanton singled with one out in the bottom of the ninth against Putkonen (1-3) and took second on a single by Logan Morrison. Both runners advanced on a wild pitch, and they held as Adeiny Hechavarria grounded out to the shortstop.

After Chris Coghlan walked to load the bases, Putkonen's first pitch to Dobbs got away. Stanton scored standing up with his arms raised, and the Marlins mobbed Alvarez.

At last it was official: Alvarez had his no-hitter, the fifth in Marlins' history, and his first since grade school.

Baseball appointed an eight-man committee on statistical accuracy in 1991 that defined no-hitters. That dropped 50 disputed games from the no-hit list.

Alvarez, acquired by the Marlins in a blockbuster trade with Toronto last November, was on the disabled list until early July with right shoulder inflammation. His only previous complete game was May 4, 2012, a six-hit shutout for the Blue Jays against the Angels. He hadn't pitched more than 7 1-3 innings this season, and the no-hitter came in his 58th career start.

The Tigers came close to a hit several times. Shortstop Hechavarria caught Ramon Santiago's liner in the third with an acrobatic leap. Detroit pitcher Justin Verlander, who is 0 for 27 lifetime, hit a drive to right field that landed foul by a couple of feet in the sixth inning.

"You need to have a little luck to throw a no-hitter," Redmond said, "and we definitely had that today."

NOTES: Tigers pitchers had 13 strikeouts Sunday and finished with 1,428 this season, a major league record. ... The crowd of 28,315 pushed Miami's final attendance total to 1,586,322. Playing in a ballpark that opened last year, they had the second-worst average attendance in the majors, ahead of only Tampa Bay.

___

Follow Steven Wine on Twitter: http://twitter.com/Steve_Wine