By Sam Bush

Bryce Harper smack a three-run homer and the Phillies avoided sliding any deeper in the NL wild-card standings with a 9-4 win over the Cleveland Indians.

Brad Miller homered twice as the Phillies stayed within five games of Milwaukee for the second wild-card spot.

But it was Harper’s 33rd homer in the fifth inning off left-hander Oliver Perez (2-4) — a shot the Ohio State football fan celebrated by flashing an “O-H” as he crossed home plate — that put the Phillies ahead and prevented them from fading further from the postseason picture.

Jay Bruce also homered in the four-run rally in the fifth and Jason Vargas (7-8) shook off a rough start to finally get his first win in his 10th outing for the Phillies.

Rookie Oscar Mercado hit a two-run homer for the Indians, who fell one game behind Tampa Bay for the AL’s No. 2 wild-card berth. The Rays beat Boston 5-4 in 11 innings.

Harper’s 413-foot shot was the kind of moment the Phillies envisioned when they signed the six-time All-Star to a 13-year, $330 million free agent contract in March.

After Indians rookie starter Zach Plesac gave up a pair of singles, manager Terry Francona didn’t want to take any chances with Harper coming up and brought in Perez, who retired the superstar on a grounder in Cleveland’s win on Friday.

But this time, Harper was locked in. He fouled off five pitches — two of them with two strikes — before pounding Perez’s 79 mph slider deep into the right-field seats to put the Phillies up 5-4.

When he circled the bases, Harper, who backs the Buckeyes football team because his wife played soccer at Ohio State, raised his arms with a sign usually reserved for fall Saturdays in Ohio. Earlier, Harper watched the Buckeyes on a clubhouse TV as they dismantled Miami (Ohio) 76-5.

Miller, who opened the season as Cleveland’s starting second baseman, opened the ninth with a homer and Harper added a sacrifice fly in the inning as the Phillies blew it open with three runs.

Two batters after Harper’s homer in the fifth, Bruce snapped a 0-for-15 slide with his 26th homer.

Vargas settled in after his defense made two errors in the first and he fell behind 4-1 after two innings. The left-hander had been 0-3 with six no-