The Dodgers were denied their first sweep in Philadelphia since 2012 and fell to 13-20 in one-run games this year. The Phillies salvaged the finale of the three-game series and held their share of the NL East lead.
"You never want to get swept, especially in your home park," said Harper, who also walked twice. "That's a good Dodgers team over there. They played us well the last two days and they played well today."
Harper hit his 21st homer and scored twice as the Phillies won with just four hits. The Philadelphia bullpen didn't allow a hit in the final 4 2/3 innings, and the Dodgers finished with only three hits.
Kennedy walked Corey Seager with one out in the ninth, walked Cody Bellinger with two outs on a call that resulted in Phillies manager Joe Girardi's ejection, then plunked pinch-hitter Will Smith in the arm to load the bases. Billy McKinney flied out to end the game.
"Well, I did learn that Ian Kennedy could get a five-out save," a visibly irritated Girardi said about his ejection by home plate umpire Alfonso Marquez.
It was Kennedy's third save in six appearances with the Phillies since coming over in a July 30 trade with Texas.
"He's done this his whole career," Harper said. "He's been in pressure situations and gone through that. There's no worry when he comes in the game. We have all the confidence in the world when he comes into the game."
Both teams used five pitchers.
Harper connected off Mitch White (0-1) for a solo drive in the first that landed four rows above the flower beds in deep left-center field for Philadelphia's first lead in the series. In the fourth, Harper walked and eventually scored a two-out single by Ronald Torreyes.
In the 36 games he's played since July 2, Harper is hitting .328 with eight homers, 23 RBI and 28 runs scored with a .444 on-base percentage. The Phillies are 23-13 in that span - a large reason why Harper's name has emerged in a wide-open field for National League MVP.
"My last two weeks haven't been very good, so I better figure it out if I want to get involved in that competition," Harper said. "But I just care about is my teammates and winning ballgames. All want to do is win, get into the postseason and play deep into October. If I'm playing well and those things can happen, those accolades will come."
Ranger Suarez, who is being stretched out into a starting role after serving as Philadelphia's closer for a month, allowed three hits and one run in 4 1/3 innings before falling into trouble in the fifth, resulting in the Dodgers only run on Trea Turner's RBI groundout.
"Every start that I have makes me feel better," Suarez said through a translator. "My pitches are better and the way I feel on the mound is better. I feel like I'm almost ready to not have a pitch limit anymore."
After Suarez departed, the Phillies used four different relievers -- Enyel De Los Santos, Hector Neris, Archie Bradley (7-1) and Kennedy.
"Suarez was good and we couldn't get any traction against him," Dodgers manager Dave Roberts said. "Seeing Archie go two and De Los Santos and Neris - we just couldn't get to the guys in the pen today."
White, who was called in to fill one of the holes in Los Angeles' rotation, allowed three hits in four innings, striking out four. The Dodgers bullpen gave up only one hit and struck out five in the final four innings, capping off a series where they allowed no earned runs and just eight hits in 14 2/3 innings while striking out 22.
"Mitchell White did everything we asked," Roberts said. "A seeing-eye grounder (by Torreyes) and Harper got him. But he pitched well and the guys in the bullpen pitched well in the whole series."
Dodgers: 3B Justin Turner will not be available to return to the Los Angeles lineup until at least Saturday in New York after missing the entire series in Philadelphia with left groin discomfort, according to Roberts. "We're going to see what capacity he will be for Saturday," Roberts said after Thursday's game.
Phillies: C J.T. Realmuto was held out of the starting lineup one day after leaving in the first inning following two foul tips that caught him in the mask. General manager Sam Fuld told reporters that Realmuto cleared concussion protocol and would be available off the bench. Backup C Andrew Knapp took Realmuto's spot in the lineup.
Dodgers: Begin a three-game series at New York Mets on Friday. LHP Julio Urias (13-3, 3.41) will start Friday night's game for the Dodgers.
Phillies: Host Cincinnati for three games beginning on Friday. RHP Zack Wheeler (10-6, 2.42 ERA) squares off against Reds RHP Tyler Mahle (9-3, 3.78).
Bryce Harper rocks a Phillies bucket hat after a HR
Bryce Harper puts one into the seats for his 21st home run of the year.