A 911 call of shots fired into Hofstra University’s library turned out to be a rock-throwing case that left a small hole — just like a bullet would have — in the second-floor window, Hempstead Village police said.

Bits of glass sprayed the computer of a student sitting by the window, and his 911 call at 10:40 p.m. reported two bullets fired, police said.

Village, university and Nassau police rushed to the library and evacuated students and staff, police said.

But as investigators questioned people and searched for evidence, the student texted his friend to stay away, saying “A sniper just tried to shoot me . . . stay safe,” said village police Lt. Paul Johnson.

His friend typed back, “It was me. I threw a rock,” Johnson said.

advertisement | advertise on newsday

Police said it was a prank and that his friend also asked him not to give him away.

No one was hurt, police said.

The rock left a tiny hole in the glass, without a web of fractures often left by rocks, authorities said.

Village police said campus police decided to handle the matter internally. A campus police supervisor said there was no information to be released.

Other details were not immediately available.