Mustapha Heron transferred to St. John’s two years ago to be close to his ill mother, Thalia, play with friend Shamorie Ponds and help return the program to relevance.

It didn’t work out as envisioned.

The former five-star recruit from Waterbury, Conn., was bedeviled by injury problems and underperformance, and now he may have played his last college game. The senior guard will “likely” be out the rest of the season, the school told The Post in a statement Tuesday afternoon.

Heron, the Johnnies’ offensively challenged second-leading scorer at 13.8 points per game, aggravated a right ankle injury in Saturday’s loss to Creighton and is in a walking boot. He has already been ruled out of Wednesday night’s game against Providence at Carnesecca Arena.

“A timetable for Heron’s return has not been set, but it is likely he will miss the remainder of the 2019-20 season,” the school said in the statement.

St. John’s sits at 2-9 in the league, just a game ahead of DePaul which is in the conference cellar. Its only two wins in the Big East have come against the Blue Demons.

The 6-foot-5 Heron initially injured his ankle Dec. 10 against Brown and missed the next three games, returning in a road loss to Xavier on Jan. 5. He struggled in Big East play, averaging 12.4 points on 36.1 percent shooting, and seemed to be hindered by the ankle. He started coming off the bench two games ago, replaced in the starting lineup by sophomore Greg Williams Jr.

As a sophomore, Heron averaged a team-high 16.4 points per game, helping lead Auburn to the SEC regular-season crown. That offseason, he transferred to St. John’s, and the expectation was he would form a dynamic one-two punch with Ponds under then-coach Chris Mullin. But Heron never seemed to fit into the offense, frequently standing out on the perimeter, waiting for the ball to be swung his way.

When Ponds and fellow starter Justin Simon left early for the professional ranks, Heron opted to stay and seemed to take to new coach Mike Anderson. He felt healthy after right knee tendinitis and sore left Achilles tendon hampered him, scored a combined 55 points in the first two regular-season games and was clearly the team’s leader early on. But inconsistency — Heron struggled in losses to Arizona State and Vermont — and the ankle injury followed.

Now it appears struggling St. John’s (13-11) may have to finish out the season without one of its most talented players and Heron’s college career could be over.