A 27-year-old man attempted to swim across the Charles River from Boston to Cambridge Thursday night after fleeing from Boston University’s campus, officials said.

The man, who was not identified, was previously prohibited from being on BU’s property, said Colin Riley, the school’s spokesman. He was spotted on Thursday night in the campus library, Riley said.

School officials reported to authorities that a suspicious male was trespassing on their property just before 11 p.m., said Trooper Paul Sullivan, a State Police spokesman.