The New Jersey native accused of fatally shooting five people and injuring six others in the Fort Lauderdale Airport massacre had been “on the dark web,” and logging in to “Jihadi chat rooms” before his rampage, it was revealed Tuesday during his court appearance.

Federal prosecutors said Tuesday that Esteban Santiago had been practicing firing his gun in ranges across Alaska preparing for the Jan. 6 bloodbath, and used the same semiautomatic handgun briefly confiscated by Anchorage cops in the airport shooting.

Following a stint in psychiatric care, Santiago was not prescribed any mind-altering drugs, agents told U.S. Magistrate Judge Lurana Snow.

The FBI has said Santiago flew from Anchorage, Alaska to Fort Lauderdale, where he unpacked checked baggage containing a 9mm handgun, loaded it in a bathroom stall, and then coolly walked through the terminal opening fire.

He had initially planned to attack a New York airport, federal law enforcement sources previously told The Post, but decided against it because of increased security.

The 26-year-old has yet to be formally charged in the attack, and has not entered a plea.

If convicted on the top counts, he could face life behind bars or even death for the shooting.

Santiago has been on suicide watch and in solitary confinement since his arrest at the Broward County main jail, authorities said.

Judge Snow declined to grant bail while the case is still pending, and he will remain jailed for now.

Santiago will return to court Jan. 30.

With Post Wires