LEWISTON, Maine — The two 12-year-old boys held in connection with two separate fires denied charges of arson in court Monday.

Brody Covey is charged in connection with the April 29 fire on Bates and Pine streets. Abdi Ibrahim is charged in connection with the May 3 fire on Pierce and Bartlett streets.

The court ordered Covey to undergo a mental evaluation. He appeared in court with counsel, his mother and her boyfriend.

Ibraham appeared with counsel and his parents.

Covey wore a red sleeveless shirt and dark shorts. After the hearing, his mother and her boyfriend kissed Covey before he was led away by a sheriff’s deputy.

Both boys were detained following the hearing.

Ibrahim, dressed in an orange T-shirt and dark pants, looked down most of the time as Judge John Beliveau spoke. At one point, Beliveau told him: “Abdi, you’ve got to eyeball me here. OK buddy?”

Beliveau told Ibrahim of his constitutional right to remain silent, employing the euphemism: “Zip it,” while drawing a line across his mouth with a finger.

The boy was led from the courtroom, silver handcuffs dangling from his thin arms, his ankles shackled.

Beliveau, who said the charges against the youths were “very serious,” told both defendants that the prosecutor could seek a bind-over hearing at which the state could argue the juveniles should be tried as adults in Androscoggin County Superior Court. Assistant District Attorney Melanie Portas said her office hadn’t decided whether to file for such a hearing.

Covey lived in one of the apartment buildings that was destroyed April 29. The fire quickly spread to two buildings on Bates and Pine streets. He was charged in a juvenile petition through the Office of the Maine State Fire Marshal with three counts of arson. Police said they believe the fire started at the back of the building.

Ibrahim of 287 Bates St. was charged with four counts of arson in a May 3 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 May 6 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.

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.