LOS ANGELES - The nation's two biggest school systems - New York City and Los Angeles - received threats Tuesday of a large-scale jihadi attack with guns and bombs, and L.A. reacted by shutting down the entire district, while New York dismissed the warning as an amateurish hoax and held class as usual.

The shutdown was a rare example of a major U.S. city closing its entire school district because of fears of an attack. The decision also reflected lingering unease in the aftermath of the shooting that killed 14 people at an office party two weeks ago in nearby San Bernardino.

In L.A., the threat came in the form of an email to a school board member. Authorities in New York reported receiving the same "generic" email and decided there was no danger to schoolchildren. Mayor Bill de Blasio concluded the threat contained "nothing credible."

"It was so outlandish," he said.

New York Police Commissioner William Bratton agreed, quipping that it looked like the sender of the threat had watched a lot of the Showtime terrorism drama Homeland.

The shutdown abruptly closed more than 900 public schools and 187 charter schools attended by 640,000 students across Los Angeles.

L.A. officials defended the move, with that city's police chief dismissing the criticism as "irresponsible."

"It is very easy in hindsight to criticize a decision based on results the decider could never have known," Police Chief Charlie Beck said at a news conference.

Southern California, he added, "has been through a lot in the recent weeks. Should we risk putting our children through the same?"

Los Angeles schools will reopen Wednesday. Mayor Eric Garcetti said the FBI has concluded it wasn't a credible threat.

The threatening 360-word email sent to the New York City school superintendent warned that schools would be attacked with pressure cooker bombs, nerve agents, and machine guns. It claimed the writer and "138 comrades" would carry out the attack.

Students "at every school in the New York City school district will be massacred, mercilessly. And there is nothing you can do to stop it," the message said.

A law enforcement official with access to the document provided the email to the Associated Press. The official was not authorized to disclose details of an ongoing investigation and spoke on condition of anonymity.

The anonymous writer claimed to be a student at a district high school who had been bullied. The person also claimed to be a jihadist but made errors that suggested the writer was really a prankster, including spelling the word Allah with a lowercase "a."

The threat made a pornographic reference to a body part that would be unlikely to come from a devout Muslim, and it contained no reference to the Quran.

The threats came in simultaneously to New York and L.A. school officials at about 1:20 a.m. EST Tuesday, or about 10:20 p.m. Monday in Los Angeles.

White House spokesman Josh Earnest said he would not second-guess the decisions made in Los Angeles or New York.