PHILADELPHIA — If there was angst on the part of Ivan Perisic, he didn’t betray it Friday.

A cornerstone of Croatia’s golden generation, Perisic remains an irreplaceable piece at age 37. His 156 caps would be monumental if it wasn’t for the guy usually positioned to his right having just earned his 200th. Both he and Luka Modric, the ageless captain, have silver medals from the 2018 World Cup and a bronze medals from the 2022 edition on their mantels.

Without something from Saturday’s visit to Lincoln Financial Field, Perisic and his team knew, Croatia’s World Cup was in danger of ending. Yet Perisic viewed the predicament with equanimity at the matchday minus-1 press availability.

“We need to do our best,” he said, via a FIFA interpreter. “We know what it takes, and we need to play better than we did in the last two matches.”

As they have so often for the last decade, Croatia rose to the occasion.

Croatia jumped out to an early lead via Petar Sucic in the 31st minute, then countered a goal by Ghana’s Derrick Luckassen in the 73rd with Nikola Vlasic’s header in the 83rd for a 2-1 win over Ghana in Group L play.

A win by England over Panama, 2-0, in a simultaneous kickoff gave the Three Lions the group win. Croatia finishes second, heading to Toronto take on the Group K runner-up, with Ghana moving on in third.

Ghana entered the game with four points knowing that it would advance no matter what, guaranteed to be one of the eight best third-place teams at a minimum. It hadn’t allowed a goal in two games, drawing England and topping Panama 1-0.

But on just three points, Croatia needed at least a draw. It played with that urgency early before a fourth straight capacity crowd of 68,324 spectators.

“We’re aware of the aware of the importance of the match we’re going to be playing, and the opponent who is very confident and full of energy,” Croatia manager Zlatko Dalic said Friday. “It’s going to be difficult. But we know what our objective is, and I believe that we will improve the things that were not very good.”

Croatia came out on the front foot early. Vlasic beat Ghana goalie Benjamin Asare in the 17th minute but not the post. Center back Marin Pongracic headed over on a corner kick in the 24th, and Perisic’s header from 18 yards on a Modric free kick in the 30th was easily handled by Asare.

Sucic finally got the breakthrough on 32 minutes. No one closed him down in a pocket of space atop the box, and the Inter Milan winger had a go. The ball was ticketed for the low far corner, but needed to go through the legs of an unlucky Luckassen to get there.

Manchester City’s Mateo Kovacic, starting in a midfielder pairing with Modric that combines for 317 caps, had a shot blocked in the 38th in a similar window of space.

Ghana finally came alive in the 40th minute. Its first shot attempt was created by its primary dangerman in this tournament, Manchester City winger Antoine Semenyo, who dashed down the right wing and fired across the face of goal. He had Dominik Livakovic beat, but the goalkeeper gratefully watched it bound wide of the post.

Ghana was better to start the second half.

Halftime sub Abdul Fatawu volleyed a shot onto the roof of the net two minutes after entering. The Black Stars finally broke through when Luckassen rode the backline on a free kick and, while it was originally ruled out on the field for Kwasi Sibo standing in an offside position, Canadian referee Drew Fischer correctly judged him not to be involved in the play. That allowed Luckassen’s one-touch finish to stand.

But Croatia was undaunted. Sub Mario Pasalic forced an impressive save from Asare in the 82nd with an effort from the top of the box.

But on the ensuing corner, Modric delivered a spot-on ball to Vlasic for the win. It was part of another magisterial performance from the 40-year-old in his 201st cap, the fourth-most in men’s soccer history.