BALTIMORE — David Peterson had mostly discounted the notion he could be selected to the All-Star Game. 

But there was the Mets left-hander being called Thursday afternoon to Carlos Mendoza’s office, where he was informed by the manager and pitching coach Jeremy Hefner that he had been chosen to the National League roster. Peterson, a first-time All-Star, is replacing Robbie Ray. 

“A little shocked,” Peterson said of his reaction to the news. “I saw some of the guys got replaced and whatnot and put it out of my head and let the game control it, and I got caught a little off guard when they called me in.” 

Peterson will join teammates Francisco Lindor, Pete Alonso and Edwin Díaz in representing the Mets.

Peterson appeared in strong position for a spot last month, but a late June slump didn’t help his cause. 

New York Mets pitcher David Peterson, #23, pitching.Mets starter David Peterson is an All-Star. IMAGN IMAGES via Reuters Connect

“It definitely put me in a position where I was probably looking in from the outside,” said Peterson, who had consecutive starts in which he allowed five earned runs and failed to complete five innings. “I just tried to put it out of my mind and go play and help this team win.” 

Peterson has pitched to a 3.06 ERA in 18 starts this season. 

New York Mets pitcher David Peterson (23) delivers during the first inning against the Baltimore Orioles at Oriole Park at Camden Yards. New York Mets pitcher David Peterson (23) delivers during the first inning against the Baltimore Orioles at Oriole Park at Camden Yards. Mitch Stringer-Imagn Images

On Thursday, he allowed one earned run over seven innings in the Mets’ 3-1 loss to the Orioles in Game 1 of a doubleheader. 

Last season, he returned from hip surgery in late May and bolstered the Mets rotation before contributing from the bullpen in the playoffs. 

“I am proud of him,” Mendoza said. “Especially with … how far he’s come. It was special for me and Hef to deliver the news today. Another guy that is going to go out there and represent the Mets organization.”