SALT LAKE CITY - A Utah schoolteacher whose gun accidentally went off in a school bathroom is agreeing to pay a fine and take a firearm safety class as part of a plea deal.

Authorities say Michelle Montgomery has already paid $200 to replace a toilet that exploded when her gun discharged in the faculty bathroom on Sept. 11.

The misdemeanour of illegal discharge of a gun will be dismissed if she pays court fees and serves a year of probation.

The 39-year-old is a concealed weapon permit holder and is allowed to have a gun at school under Utah law, which prohibits administrators from asking if teachers carry guns.

The Salt Lake Tribune reports that police say the gun went off after she put it on top of a toilet-paper dispenser.