A sportswriter who was with Jets coach Rex Ryan when he flipped the bird to a Miami Dolphins fan last week said Thursday that the fan had gone “over the line” and that Ryan actually showed remarkable restraint.

“This was a guy going out of his way to incite a fight, to incite some sort of violence, to get the head coach of the Jets – to ruin his job,” FoxSports.com writer Jay Glazer said during an appearance on WFAN radio.

The incident, at a Mixed Martial Arts event Saturday night in Miami, made headlines after Ryan was photographed extending his middle finger at the fan. He later apologized and was fined $50,000 by the Jets, although he wasn’t punished by the NFL.

Glazersaid the coach deserved “50 grand for not hitting the guy.”

According to Glazer, the fan, whom he described as drunk, harassed Ryan on three separate occasions that night, cursing at him and calling him “a fat piece of crap.”

advertisement | advertise on newsday

“He said, ‘hey, I effing hate you, I hate you, I hate you, you’re an effing piece of eff . . . I hope you die,’” Glazer said of the fan.

He said the man then spit on Ryan, though it was unclear if that was intentional.

After the incident became public, Jets General Manager Mike Tannenbaum said in a statement that the coach has shown “extremely poor judgment” and that his “conduct was inappropriate.”

Calls to the Jets Thursday were not returned.