TRENTON, N.J. — An appellate panel upheld the firing of a Paterson, N.J., first-grade teacher who called her students “future criminals” in a Facebook post.

The two-judge panel ruled Friday that Jennifer O’Brien’s conduct wasn’t protected by the First Amendment and that her “right to express those comments was outweighed by the district’s interest in the efficient operation of its schools.”

O’Brien, a Paterson teacher since 1998 who lives in Elmwood Park, was suspended May 5, 2011, for two comments made earlier that year on her Facebook page.

“”I’m not a teacher — I’m a warden for future criminals!” she wrote. “They had a scared straight program in school – why couldn’t (I) bring (first) graders?”

O’Brien’s attorney had argued that she was concerned about a few students’ behavior and believed they needed help and said her actions warranted minimal, if any, punishment.

The incident drew national media attention, with news crews camped outside School No. 21, where O’Brien taught. Parents expressed outrage at the posting at a Home-School Council meeting held shortly after her posts.

An administrative law judge said O’Brien’s comments merited dismissal, and state Education Commissioner Christopher Cerf upheld the ruling in a December 2011 decision. The Appellate Division heard O’Brien’s request to reinstate her in December.

Nancy Iris Oxfeld, O’Brien’s attorney, said O’Brien disagreed with Friday’s ruling but declined further comment.