It is the Dark Knight’s darkest hour.

Mets general manager Sandy Alderson made the stunning announcement Friday afternoon that Matt Harvey was being designated for assignment after refusing a minor league assignment, ending the brief, once-brilliant and often-chaotic run for the pitcher whose peak popularity and dominance have few rivals in team history.

Harvey, who will become a free agent if the Mets cannot trade him in the next seven days, posted a 10.50 ERA in four appearances in his new bullpen role. That prompted a meeting with Alderson, manager Mickey Callaway, pitching coach Dave Eiland and assistant general manager John Ricco at 3:15 p.m. Friday. Harvey was asked to go on a minor league assignment with the team “feeling it was in his best interest and the best way for him to return to his former stature as a starting pitcher of great ability,” Alderson said.

Harvey, told the demotion would be for a set period of time, was given time to think about it and speak with his agent, Scott Boras. By 4 p.m., Alderson was uttering words he never could have envisioned when the right-hander was starting in the 2013 All-Star Game at Citi Field and shining in the 2015 World Series.

“As I was walking in here, I said to [media relations director] Jay Horwitz, ‘It’s the end of an era,’ ” Alderson said. “Matt has been a cornerstone of my tenure here, a tremendous prospect from the time I arrived, tremendous accomplishments, and a very unfortunate and difficult conclusion, not really of his making. This is somebody that’s gone through two serious and career-threatening injuries … and made every effort to return to the championship level he exhibited so often over the years.

“Obviously there were challenges along the way for him and for us, but those challenges were always worth meeting … in spite of some issues … he was always appreciated for what he brought to the New York Mets.”

Drafted by the Mets with the seventh-overall pick in 2010, Harvey had a tight but fleeting grasp of the city spotlight he uniquely embraced, beginning with his breakout 2013 campaign, in which he finished fourth in the NL Cy Young voting.

Harvey missed all of 2014 after undergoing Tommy John surgery and was named the NL Comeback Player of the Year in 2015, but made just 16 starts the next season and underwent surgery for thoracic outlet syndrome in July 2016.

Harvey had a 6.70 ERA last season, but Callaway and Eiland were convinced they could help the former star approach his peak again. Instead, the 29-year-old had a 6.00 ERA in four starts this season — compiling a franchise-worst stretch of 11 straight starts in which he failed to throw more than five innings — and was pulled from the rotation.

During Friday’s meeting, Callaway relayed stories of Roy Halladay and Cliff Lee, who were both sent to the minors after spending significant time in the majors and returned to win Cy Young awards, but Harvey was unmoved by the latest arguments to unearth his long-faded talent.

“We feel like we failed Matt Harvey,” Callaway said. “We thought from our evaluation in spring training that we could get him where we wanted him to be, and we didn’t.”

Alderson didn’t expect Harvey to accept the assignment — Harvey didn’t have to, under rules of the collective bargaining agreement — but the general manager was hopeful the right-hander would be willing to work on his mechanical issues after allowing five runs in two innings during Thursday’s loss to the Braves.

“We’ve tried to find some other solution over a fairly long period of time,” Alderson said. “This was a long time coming.

Harvey had caused issues for the Mets long before his struggles on the mound.

Before the 2015 playoffs, Harvey missed a mandatory workout, angering teammates and management. Last May, Harvey was suspended for three games after he didn’t show up at Citi Field, which Page Six reported was due to him seeing pictures of former girlfriend Adriana Lima at a party with Patriots wide receiver Julian Edelman. The Mets even dispatched two security officials to Harvey’s apartment to ensure he didn’t need medical help, with the pitcher — found wearing pajamas — claiming he was suffering from a headache.

On Harvey’s way out, he managed to create one final negative headline, with Page Six reporting last week the pitcher was partying in Los Angeles the night before making a bullpen appearance in San Diego.

Still, Alderson and Callaway said the decision had nothing to do with Harvey’s actions off the field.

“I don’t think he was a burden,” Callaway said. “I think everyone knew Matt Harvey really well, and accepted the person he is. … To have a successful team, you don’t have to like every characteristic of every person in there. I don’t think guys thought he was a distraction.”

One of the greatest opening acts in Mets history is abruptly finished, even as Alderson acknowledged it’s “conceivable he could get back” to his best again.

It won’t be in Queens, though. Harvey Days are done.

“I think there are a lot of issues that come with him and his experience in New York that perhaps a change of scenery will help, and we felt it was worth trying ourselves,” Alderson said.

“My guess is there are people out there who are willing to take a shot on Matt Harvey. We’ll see.”