BOSTON (AP) — A man accused of secretly filming boys in restrooms at a Boston high school will be detained pending the outcome of his trial.

Magistrate Judge M. Page Kelley wrote in an order issued Saturday that 36-year-old Eric Tran Thai poses a risk of flight and danger to the community if released.

READ MORE: Nearly Half A Million Lose Power As Nor'easter Hits Massachusetts

Thai is charged with videotaping students at Boston Latin School while as they used stalls or urinals. Thai also faces state charges for allegedly filming in men’s restrooms at Boston College.

Eric Tran Thai outside Boston federal court (WBZ-TV)

READ MORE: Plymouth Homeowners Scramble For Emergency Supplies After Damage From Nor'easter

Prosecutors have said a search of devices taken from Thai’s home also turned up folders with labels including MIT and Harvard. The forensic analysis of those files is ongoing.

Thai’s attorney has told The Boston Herald that he will appeal the detention order.

MORE NEWS: 'The Wind Was Crazy': Almost All Of Scituate Without Power After Nor'easter

(© Copyright 2019 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)