Pedestrians on the MIT Campus duck under police tape Saturday following reports of a gunman at the school.

CAMBRIDGE, Mass. — A false report of a gunman at the Massachusetts Institute of Technology that briefly caused a campus-wide lockdown Saturday stemmed from an electronic message sent to police, authorities said.

Officers searched for a man reported to be carrying a long rifle and wearing body armor but found nothing unusual, Cambridge police said. The report — that alleged the gunman was barricaded inside a building on campus — turned out to be a hoax, and there was no threat to public safety, state police spokesman David Procopio said.

Cambridge police received the tip in an electronic message around 7:30 a.m., but witnesses on the scene eventually contradicted it, spokesman Dan Riviello said. Neither police nor MIT specified how the tip was received, though the police department’s website says anonymous tips may be made via text message or email, in addition to a telephone hotline.

“The MIT community was sent a precautionary text message at 8:52 a.m. asking them to remain indoors and shelter in place,” the university said in a statement issued following online criticism over the delay in alerting the public that a gunman was possibly on campus. It did not explain why it took more than an hour to issue the alert.

A room-to-room search by MIT and Cambridge police, along with state police troopers, led officers to declare that the scene was clear at about 10:30 a.m., MIT said.

“No armed suspects were found in the building or on campus and police believe that the event, as reported, did not occur,” according to a statement by Cambridge police.

Investigators are trying to identify the prankster and will pursue criminal charges if they do, Riviello said.

He declined to provide additional details or confirm reports that the IP address used by the prankster has been traced to New York, saying the investigation continued.

John DiFava, chief of MIT’s campus police, acknowledged the delay in telling students about a possible gunman on campus. “I have to look into it and find out the reason for the lag,” he told the Boston Globe.

Junior Zach Wener-Fligner told the newspaper that the delay was “a little worrisome.”

“But I assume the relevant area was locked down,” he said.

About 11,000 people attend the prestigious school outside Boston where students are famous for their smarts as well as their stunts, including once putting a police car on top of a domed campus building.