He was 25 feet from the basket.

He was losing his balance.

He was acutely aware that the clock was winking under 0:01 in Wednesday night’s instant classic of a PIAA Class 6A state tournament game.

But Zahmir Carroll felt good about his chances of making the biggest shot of his life. He knew he had help.

“I knew he was with me,” Carroll said of his former Chester High teammate, sophomore Edward Harman.

Harman was shot and killed on Tuesday. Another Chester player, sophomore Jermere Clark, was shot in the same incident and remains hospitalized.

Chester players decided that Wednesday night’s game with Simon Gratz would be held as scheduled at Cardinal O’Hara High.

Then the Clippers went out and registered one of the most emotional victories in their rich history, beating Gratz, 63-62, when Carroll’s three-pointer beat the game-ending buzzer in storybook fashion.

“I knew it was going in,” Carroll said of the shot that brought hundreds of Chester fans pouring on the court in wild celebration.

One of those fans held up a basketball jersey with the No. 35 -- Harman’s jersey number -- in silent tribute to the popular sophomore, an honor-roll student who rarely missed school, according to Chester athletic director Andre Moore.

Chester junior forward Karell Watkins, who led all scorers with 22 points, said Carroll’s shot had some special assistance.

“I know Ed was guiding that shot,” Watkins said.

The remarkable shot capped an emotional day for the Clippers, who wrestled with the decision to play the game.

Moore said Chester coach Keith Taylor allowed the players to make the choice.

“At first we weren’t going to play,” Watkins said. “But we know Ed would want us to play.”

With the victory, Chester (23-4) advanced to play Reading in the state quarterfinals Saturday at a date and time to be determined.

It was a poignant scene before the game, with a moment of silence for Harman and a presentation of a signed basketball to his family by players from the Mastery Charter girls and Simon Gratz boys teams.

“It’s just been a really tough stretch,” Moore said. “We’re trying to get these kids through it.”

Moore said there were counselors in school on Wednesday to help the players and other students.

“I’m just so proud of these kids,” Taylor said. “I’ve been proud of them all year. But this, they’ve been through a lot.”

Down 34-19 early in the third quarter, Chester rallied behind Watkins, Carroll and junior guard Fareed Burton.

The Clippers went on a 17-2 run, thrilling their vocal supporters, and taking a 43-41 lead after three.

But Gratz rallied back in the fourth behind senior guards Yasir Rowell and Yassir Stover and senior swing man Kyyon Gordon.

Back and forth the teams went in the final eight minutes with several ties and lead changes in a epic battle between two of the Philadelphia-area’s most fabled programs.

Gratz held a 59-54 lead with a little more than 90 seconds left but Burton and senior guard Rahmee Gilbert hit layups.

Twice the Bulldogs seemed to grab control and twice the Clippers answered.

“We never quit,” Watkins said.

With 0:04.5 on the clock, Gratz senior Edward Harris made one free throw for a 62-60 lead. He missed the second.

Chester senior Akeem Taylor, the coach’s nephew, grabbed the rebound, took one dribble and passed to Carroll on the right side.

Carroll seemed to stumble as the horn was about to sound. He released an off-balance shot that fell through the net in what seemed, to the Clippers and their faithful fans, like a miracle.

In the swirling sea of orange-and-black-clad supporters on the court after the game, Carroll held high Harman’s practice jersey.

“Everything was for them," Carroll said of Harman and Clark.

Gratz 12 19 10 21 — 62

Chester 9 10 24 20 — 63

G: Ed Harris 6, Yasir Rowell 14, Yassir Stover 12, Kyyon Gordon 10, Ross Carter 4, Duane Satchell 10, Oronde Ali 3.

C: Fareed Burton 14, Rahmee Gilbert 6, Akeem Taylor 10, Zahmir Carroll 11, Karell Watkins 22.