A college student with a “Star Wars” lightsaber in a campus parking lot sparked an alert Wednesday morning at Farmingdale State College, where staff and students were briefly advised to stay wherever they were, officials said.

A student alerted campus police about 9:45 a.m. after seeing a person assembling what appeared to be a rifle in a car in a campus parking lot, Suffolk County police said.

advertisement | advertise on newsday

“It was not a weapon. It was a toy lightsaber,” Insp. Mathew Lewis, commanding officer of the First Precinct, said after the investigation.

Campus police alerted the county police, and officers from both forces flooded the parking lots to find the car, Lewis said.

Officers finally found the occupant of the car, also a student, at his off-campus job and established that the supposed weapon was a toy, Lewis said.

Suffolk County police emergency service officers talk to a student at Farmingdale State College, where a person reported seeing a person with a rifle around 9:40 a.m. on Wednesday, March 16, 2016. After an investigation, police said the man was only carrying a lightsaber. Photo Credit: James Carbone

The school issued an alert to students, faculty and staff advising them to “shelter in place,” according to a text message a student showed a reporter. The alert was lifted shortly before 11 a.m.