CONEY ISLAND - A Brooklyn high school teacher was arrested and charged Wednesday after allegedly sending obscene messages and videos over the Internet to an undercover cop he thought was a 14-year-old girl.

Investigators say Alexander Kravitz, who teaches at Grady High School in Coney Island, was arrested when he allegedly showed up in Queens to meet a teenage girl for a sexual encounter. An undercover police officer was pretending to be the girl Kravitz communicated with.

Police say Kravitz allegedly used his personal computer to send the undercover cop obscene images, messages and videos of him masturbating. Kravitz was released on bail Friday, but faces several charges including second-degree attempted rape and first-degree attempted dissemination of indecent material to minors.

The Board of Education issued a statement that says Kravitz has been reassigned to an administrative office away from children. Authorities say he faces up to four years behind bars if convicted. He will appear in court later this month.