FRYEBURG, Maine — A Fryeburg Academy student who was expelled about a month ago is accused of going to the school and setting a fire in the gymnasium.

Dyllan A. Wilson, 18, of Maple Street in Fryeburg, was arrested Wednesday evening on charges of arson and criminal trespass.

Wilson was in custody Thursday at the Oxford County Jail in Paris. His bail is set at $15,000 cash or $50,000 worth of real estate.

A conviction for arson is punishable by up to 30 years in jail and a fine of up to $50,000.

According to officer Richard Murray of the Fryeburg Police Department, Wilson entered the building on the pretense that he had to use the bathroom and set a cork board and attached papers on fire at about 3 p.m. Wednesday. He left, Murray said, and students extinguished the fire before it could spread.

Murray said he arrested Wilson a few hours after the fire.

He said Wilson’s brother was also present when the fire was set but hadn’t been charged with a crime. Neither of them should have been in the gymnasium, he said.

The gymnasium replaces one that was burned down in October 2005 by two men. One, Fryeburg Academy graduate Philip Thibault, pleaded guilty to the fire and was sentenced to 40 months. The other, Maxx Noble, was found guilty of conspiracy but acquitted of an arson charge and got a 57-month sentence. The two were ordered to pay $1.8 million in restitution for the building.