Josh Gordon, the troubled wide receiver who appeared to find solid footing and success in New England this season, said Thursday morning that he was leaving the Patriots, a few hours before the NFL announced that he’s been suspended indefinitely for violating the terms of his conditional reinstatement under the sport’s substance abuse policy.

The league did not provide further details.

Gordon, 27, missed all of the 2015 and 2016 seasons because of suspensions related to substance abuse before being conditionally reinstated during the 2017 season. This will be his fifth suspension since he entered the league in 2012.

“I take my mental health very seriously at this point to ensure I remain able to perform at the highest level,” Gordon tweeted Thursday morning. “I have recently felt like I could have a better grasp on things mentally. With that said, I will be stepping away from the football field for a bit to focus on my mental health.

“I would like to thank Coach [Bill] Belichick, [Patriots owner Robert] Kraft, as well as countless others within the Patriots organization for their continued support,” he wrote. “I want to thank my fans for their support as well as I continue down the path getting back to 100%.”

The Patriots said they support Gordon “in his continued efforts to focus on his health,” adding in a statement that “his attempt to do so is a private and personal matter, which we intend to respect.”

Gordon appears increasingly likely to be remembered as an example of unrealized football potential. He was drafted by the Cleveland Browns in the second round of the 2012 supplemental draft, having starred at Baylor in 2010 before being suspended from the team for off-field issues and transferring to Utah. As a second-year pro in 2013, he caught 87 passes for 1,646 yards and nine touchdowns in 14 games, which projected to 1,881 receiving yards over a 16-game season — a figure that would have been the second-best single-season total in NFL history. But he was suspended repeatedly under the league’s substance abuse policy and, before this fall, had played in only 10 regular season NFL games since his breakout season in 2013.

He was reinstated by the NFL in November of 2017, with Commissioner Roger Goodell saying the responsibility for his continued eligibility would be up to Gordon.

“[E]veryone — including Josh’s teammates and coaches, the Browns' ownership and organization, the Program professionals and all of us at the league office — want him to have every opportunity to resume his career and to be successful in the NFL,” Goodell said in a statement then. “Whether that happens, however, at the end of the day will depend on Josh. His commitment to sobriety and to reaching his goals in football and beyond will determine his success. It ultimately is up to Josh.”

Gordon played five games last season, and returned to the Browns for all of one game in September, reportedly showing up late to the team’s facility with a hamstring injury that, according to reports, was suffered at a promotional event.

With Cleveland’s patience finally exhausted, the Browns traded the receiver to New England on Sept. 17 for a conditional fifth-round pick. He played in 11 games with the Patriots and had 40 catches for a team-high 720 yards and three touchdowns. But he had just one catch for 19 yards in last week’s loss to the Steelers, four days before his and the league’s subsequent announcements.

Gordon, who practiced with the Patriots Wednesday, had become New England’s No. 2 option at wide receiver, behind only Julian Edelman. Chris Hogan, Phillip Dorsett and Cordarrelle Patterson will likely be relied upon more in Gordon’s absence. The 9-5 Patriots have looked shaky in recent weeks, and currently trail the Houston Texans for the AFC’s final first-round bye.

Read more from The Post:

Tom Wilson won the fight; the Penguins won this round of the war with the Capitals

‘The only disability is a bad attitude’: A Syracuse recruit let his friend with cerebral palsy take center stage

After 14 years, two combat zones and a hat trick, a mission to find a beloved Nats cap

Warning: You might be disgusted by Patrick Mahomes’s new ketchup ad

Olympic swimming gold medalist Missy Franklin retires at 23, citing chronic pain