A New Jersey man was arrested by federal authorities after cops found his phone number scrawled on a note in one of the Jersey City shooter’s back pockets, according to officials.

Ahmed Hady’s Monmouth County pawnshop, Buy N Sell City, and house were searched over the weekend — and feds found him illegally in possession of six rifles, including three AR-15-style assault rifles, three handguns and one shotgun, US Attorney Craig Carpenito said.

Authorities also found hundreds of bullets, including a “large number” of hollow-point rounds, according to the criminal complaint.

The feds tracked down Hady, 35, in Keyport on Friday evening after finding his phone number on a handwritten note on 47-year-old David Anderson — who gunned down a Jersey City cop and then opened fire inside a Jewish food store Tuesday, killing three.

The FBI raid on the pawnshop lasted 13 hours, from Saturday afternoon to Sunday at around 7:30 a.m., according to Hady’s brother Adhem and their father, Alaa Hady. They are cooperating with the FBI and have handed over their phone records, they said.

The relatives insisted Sunday that Anderson having Ahmed’s phone number was just “bad luck.”

“It’s really just bad luck that they just happened to have the phone number,” Adhem told The Post on Sunday.

“When we saw the photos of the suspects we didn’t even recognize those people,” he added. “We or my brother have never seen or communicated with those people.”

Adhem said his brother is engaged, with two daughters, and “would never get involved with something like that.”

“In the stores, we never purchase, never sold anything gun-related,” he said.

The family said the pawnshop in Keyport is owned by the father and that Ahmed lives in an apartment over the store.

Ahmed, who spent two years on probation after pleading guilty to forgery charges in 2011, owns a similar pawnshop in South Amboy called Buy N Sell World, according to his family.

Anderson and his female accomplice, Francine Graham, were fatally shot by police during an hours-long standoff in the Greenville neighborhood, where hundreds of rounds were fired.

The FBI is investigating the rampage as a “domestic terror event” after finding a manifesto and social-media posts connecting the murderous pair to anti-Jewish hate groups, including the Black Hebrew Israelite movement. Despite their ties to hate groups, federal authorities believe they acted alone.