The fans filtered into Citi Field, Mets caps fitted snugly over their heads, iconic poofs of hair spilling out to their shoulders. For one evening — hair-hat day — everyone was Jacob deGrom. But that same evening, the Mets lost the only Jacob deGrom that mattered.

The Mets announced Saturday that the righthander, slated to start Sunday for the first time in almost three weeks, instead likely will miss the rest of the season with a pinched ulnar nerve in his right elbow. Surgery is necessary, general manager Sandy Alderson said; deGrom specified that the procedure will remove scar tissue that has developed around the nerve, pinching it.

Alderson said the problem is somewhat common with players who have undergone Tommy John surgery, as deGrom did in October 2010. Recovery from the surgery requires about three months, deGrom said, but they haven’t decided whether he’ll have it right away or wait on the slim chance he can pitch in the playoffs.

“I’m definitely disappointed,” deGrom said. “Last week felt good. Even yesterday, throwing off the mound, I felt fine. I went to throw a ball in BP and it kind of flared up again . . . After yesterday, I don’t think this [pitching through the pain] is going to happen.”

It’s devastating news for the Mets, who are in the thick of the wild-card race and whose highly vaunted starting rotation has been eviscerated by injuries. DeGrom, Matt Harvey, Steven Matz and Zack Wheeler either are unable to pitch or on the disabled list, and all but Matz are considered to be done for the season. The only arms left from the original rotation are Noah Syndergaard — pitching with a bone spur in his elbow — and the indefatigable Bartolo Colon, 43 years old and apparently unbreakable.

Wheeler had Tommy John surgery in March 2015, Harvey had surgery to correct his thoracic outlet syndrome in July and Matz likely will need surgery in the offseason for a bone spur in his elbow.

DeGrom had what he, Alderson and Terry Collins called a strong bullpen session Friday before he moved off to the outfield to shag fly balls. He tried to throw a ball into a bucket, he said, and felt the pain.

advertisement | advertise on newsday

The issue might have had less to do with that last toss and more to do with all the pitches he threw before that, he said.

DeGrom’s greatest concern during his botched recovery was how his arm would respond between innings after the nerve had been aggravated.

“I watched Jake’s bullpen yesterday,” Collins said. “It was outstanding, and 15 minutes after batting practice was over, he walked in and said, ‘I can’t pitch.’

“I talked to him again this morning. He’s very upset about the fact that he still feels it today.”

Before going down, deGrom (7-8, 3.04 ERA) struggled in his last three starts because of what he deemed a mechanical issue. Now it appears possible that his mechanics might have been off to compensate for the aggravated nerve.

Mets videos

Speaking about the injury, Collins seemed almost resigned. (Though who can blame him? He’s lost Neil Walker and David Wright for the season, too.)

It’s “nothing any more damaging than the other ones, basically, that we had and didn’t expect,” he said. “You’ve got to be resilient and there’s no guarantees anything is going to happen on a daily basis. You’ve got to get ready for tomorrow, and hopefully the guys that we run out there get some big outs.”

On Sunday, the Mets will trot out rookie Gabriel Ynoa for his first major-league start. Collins also plans to use a “plethora of pitchers” to finish the game.

DeGrom said he first started experiencing symptoms about five or six starts ago, when he felt numbness in his pinky and ring finger, but was able to pitch through it. Then, after his last start against the Marlins Sept. 1, things escalated: He signaled the trainer after pitching the fifth inning and reported the same pain he experienced Saturday.

The MRI came back negative — meaning there was no damage to the ligament — but further assessment showed he eventually would need surgery to free the nerve. Both he and the Mets hoped the surgery could be postponed until after the season, given that doctors informed deGrom that he could not injure it further, he said. Friday’s setback, though, indicated that pitching through it likely would be impossible.

advertisement | advertise on newsday

“He was hoping to be able to pitch through it, but given the fact that this thing flares up at unpredictable times and under unpredictable circumstances, I think it’s unlikely that he’ll pitch again this season,” Alderson said.

Added deGrom: “If I had to guess, I’d say [this is] it. We tried the rest, and if it’s going to get like that trying to get back and ready to go, then I don’t think facing hitters is going to get any better . . . I was looking forward to getting a chance to go out there and face hitters and see how it responded, but trying to get ready to do that yesterday, it just wasn’t good.”