LEWISTON, Maine — The state Friday formally charged two local 12-year-olds with setting fires that burned downtown buildings and displaced nearly 200 people in the span of five days.

Brody Covey, who lived in one of the apartment buildings that was destroyed, is accused of setting fire to 105 Blake St. on April 29. The fire quickly spread to two buildings on Bates and Pine streets. He was charged in a juvenile petition through the state fire marshal’s office with three counts of arson. Police said they believe the fire started at the back of the building.

Abdi Ibrahim of 287 Bates St. was charged with four counts of arson in a May 2 fire that burned four apartment buildings and a garage on Pierce and Bartlett streets. Police said they believe the fire was started at the garage. An accelerant likely was used, police said.

Ibrahim lives with his mother, Marian Ibrahim, according to court papers. His father, Yussef Abdi, lives at a separate address in Lewiston.

Covey’s legal guardian is listed as Jessica Reilly, who’s staying at the Ramada Inn with help from the American Red Cross. No father is listed in his court file. According to a relative, he is a seventh-grade student at Lewiston Middle School.

A detention hearing was held Monday for the two boys, but it was closed to the public. They had been held at the Long Creek Youth Development Center in South Portland pending that hearing. Both boys are scheduled to be arraigned Monday in Lewiston District Court where they are expected to deny the charges.

Police said they don’t believe the two boys or the fires are connected.

Covey’s family had been ordered to leave the Blake Street property, but had filed a temporary restraining order to be allowed to remain in their second-floor apartment until a court hearing that was scheduled for two days after the fire.

The apartment buildings at Blake and Bates streets were demolished within days of those fires.