Harper hit his first home run of spring training in the first inning on the 9-7 victory at Spectrum Field. He returned to the plate for his second long ball in the fourth frame before being replaced in the top of the fifth inning.
"I was just trying to have good at-bats and see pitches and jump on pitches when I could," Harper told reporters.
Hector Noesi started the game on the mound for Pittsburgh. The right-handed pitcher began the bottom of the first inning by giving up a leadoff home run to Phillies catcher J.T. Realmuto. Noesi walked Scott Kingery before Harper stepped up to the plate. Harper proceeded to smash a Noesi offering over the right field fence, giving the Phillies a 3-0 lead.
Harper grounded out in his next at-bat in the second inning. The Pirates added two runs in the inning, while the Phillies scored once. The Phillies increased their lead to 5-3 on a Neil Walker RBI single in the third inning.
Harper returned to the plate in the fourth frame, with Nick Maton standing on third base. He whacked one of Yacksel Rios' pitches to the opposite field, clearing the left field fence and giving the Phillies a 7-3 edge.
The Pirates plated another run on a fifth-inning error. Adam Frazier hit a solo homer in the sixth inning, cutting the Phillies' lead to 7-5. The Pirates plated two more runs in the seventh inning before tying the score at 7-7 in the top of the eight frame. The Phillies responded with a two-run homer from Carlos De La Cruz in the bottom of the inning and held on to earn the win.
The Phillies used a split-squad lineup for Wednesday's game. The other half of the squad had a game Wednesday night against the New York Yankees in Tampa, Fla.
Harper missed two weeks of spring training last year because he didn't sign his contract with the Phillies until late February. The six-time All-Star hit .260 with 35 home runs and a career-high 114 RBIs in 157 games last season.
The Phillies host the Toronto Blue Jays at 1:05 p.m. EST Thursday in Clearwater.