Galarraga had sent 26 consecutive batters back to the bench when in the ninth inning with only one out to go, Jason Donald of the Cleveland Indians hit a ground ball towards first.
First baseman Miguel Cabrerra cleanly fielded the ball and tossed it to Galarraga, who was covering first, seemingly in time to get Donald out.
To the shock of Galarraga and a stadium full of fans, Joyce spread his arms wide, calling Donald safe.
The call was immediately disputed by Tigers manager Jim Leyland and several other players, and instant replays showed that Donald was clearly out. The nearly 18,000 fans at Detroit's Comerica Field, many clearly irate, launched into raucous booing.
Galarraga, however, just smiled and started back for the mound. After the game, though, he expressed his frustration.
"I feel sad," Galarraga said. "I just watched the replay 20 times and there's no way you can call him safe. ... [The umpire] needs to do a better job in that situation. It wasn't even close."
Joyce also had regrets after the game, saying through tears that he "cost the kid a perfect game." The veteran official, with 20 years of experience in the MLB, said he blew "the biggest call of my career."
Despite MLB's decision, Galarraga may still earn a place in the record books for last night's game, though he'll have an asterisk by his name.
Baseball-Almanac.com now lists Galarraga on its perfect game page under a new category: "Blown Call."
Though a perfect game is a rare occurrence in the history of baseball, Galarraga's would have been the third this season, following Oakland's Dallas Braden and the Philadelphia Phillies' Roy Halladay, who both threw perfect games last month.
ABC's John Berman and the Associated Press contributed to this report.