PITTSBURGH (AP) — Phillies manager Gabe Kapler spotted a man strolling over to the third base umpire and figured it was a member of the PNC Park grounds crew. After all, there had been a rain delay a little earlier.

Kapler soon realized he was wrong.

Especially when the man, wearing a Hawaiian shirt and carrying a cellphone, turned away and casually walked toward home plate to approach Philadelphia hitter Brad Miller for a handshake.

Long after a fan just made his way onto the field in the sixth inning before being apprehended, the Phillies beat the Pittsburgh Pirates 2-1 Sunday on Rhys Hoskins’ home run in the 11th inning.

Still, Kapler couldn’t comprehend what had happened.

“Everyone was just like, ‘Hey, what’s that guy doing?'” he said. “But nobody felt threatened until he started to get close to the umpire and he’s in like street clothes. It was crazy. It was really bizarre.”

Moments after Bryce Harper argued a called third strike and Hoskins spiked his bat after being hit by a pitch, Miller backed away while being approached in the batter’s box by the sauntering fan.

The man kept walking before being handcuffed by security personnel at the top of the steps to the Phillies dugout and led away. Miller then grounded into an inning-ending double play.

Hoskins hit his 21st home run, and his second in 17 games since June 29, connecting off Chris Stratton (1-3).

“Sometimes you just need to be reminded that you can do it,” Hoskins said. “You still can do it. I barreled a ball right at a guy early in the game. It just doesn’t feel the same when it doesn’t get the job done. Hopefully, it’s big.”

The drive came right after Harper again seemed displeased with plate umpire Ben May when striking out looking to start the inning. After a being called out on a slider at the top of the zone, Harper crouched in the box for several seconds before flicking dirt and returning to the dugout.

Phillies reliever Ranger Suárez (3-0) got Starling Marte to ground out to end the 10th, stranding Adam Frazier at third, and worked around a hit in the 11th.

Drew Smyly made his first start with the Phillies, allowing one run and four hits in six innings. He also struck out.

The 30-year-old lefty was 1-5 with an 8.42 ERA in nine starts and four relief appearances this year for Texas, which released him on June 25. Smyly signed a minor league contract with Milwaukee on July 1, went 1-0 with a 4.97 ERA in three starts for Triple-A San Antonio, then on Thursday exercised his right to be released.

“It’s definitely a great one to start off on and just try to build off of it,” Smyly said. “It was a lot of fun just being out there with a new group of guys with a fresh start. … Just going to try to roll with it.”

Pirates starter Dario Agrazal allowed one run on three hits with five strikeouts in six innings. The 24-year-old rookie has given up a combined eight runs (seven earned) in 28 innings through his first five starts.

“Just maintaining the attack,” Agrazal said. “The mentality of attacking, locking in on pitches and on hitting the zone, and maintaining my mentality was continuous and consistent.”

Melky Cabrera put the Pirates ahead 1-0 in the first with an RBI single. The Phillies tied it in the fourth when César Hernández came out of a 25-minute rain delay and singled home Harper.

Pittsburgh has scored 25 runs in nine games since the All-Star break.

“Overall, though, (we’re) not getting a string of hits,” Pirates manager Clint Hurdle said. “The consecutive good at-bats. Some extra-base hits. A home run here and there. None of that’s really happening.”

ROSTER MOVE

Phillies: RHP Fernando Salas was designated for assignment to open a roster spot for Smyly. Salas (0-0, 6.75) allowed two runs on eight hits in 2 2/3 innings across three appearances for Philadelphia this season. RHP Nick Pivetta moved to the bullpen to make room for Smyly in the rotation.

TRAINER’S ROOM

Phillies: SS Jean Segura left after the top of the fourth inning because of heel soreness. He was 0 for 2 before Scott Kingery moved from center field to replace Segura at shortstop.

UP NEXT

Phillies: RHP Aaron Nola (8-2, 3.77) starts at Detroit on Tuesday. Since last losing in a 2-1 defeat against Miami on June 21, Nola is 2-0 in five starts while allowing seven runs (six earned) in 32 2/3 innings.

Pirates: RHP Trevor Williams (3-3, 5.17) could start against St. Louis on Monday if well enough after being scratched from his last projected start on Saturday because of flu-like symptoms.