ROCKLAND, Maine — A man serving a life sentence for murder and 80 years for another brutal attack that nearly killed a young girl told a judge Wednesday he would consider pleading guilty to assaulting a prison guard, but he first wants to be released from segregation.

David G. Fleming, 57, appeared Wednesday in Knox County Unified Court on a hearing concerning the charge he assaulted a corrections officer.

Two corrections officers and three court officers watched over Fleming for the hearing before Justice Daniel Billings.

Fleming is representing himself, though attorney Roger Hurley has been assigned to assist the defendant. Hurley attempted to withdraw as Fleming’s attorney, but the judge rejected that request earlier this month.

The charge against Fleming stems from a June 2014 incident at the prison in which a guard was assaulted. The guard suffered significant injuries in the assault, Assistant District Attorney Jeffrey Baroody said.

Fleming asked the judge if the district attorney could talk with prison officials concerning Fleming being held in segregation.

“I don’t want to spend years in segregation because they don’t like me,” Fleming said. “If I don’t get some consideration, I will go to trial and represent myself.”

Billings told Fleming there was nothing the court or the district attorney could do concerning the administrative handling of his housing within the prison.

No action was taken at the hearing, and the case will next be heard in November.

Baroody said the state is pursuing this case, even though Fleming is serving a life sentence because the rule of law must be enforced in a prison. He said there is a deterrent effect for prisoners who see an end in sight for their prison terms.

Fleming was convicted in 1991 of using his car to strike a 15-year-old girl riding her bicycle, putting her in his car, raping her, then taking her into the woods where he stabbed her in the chest and slashed her in the throat before burying her under leaves, thinking she was dead, before going to work at a McDonald’s restaurant. The girl survived by pretending to be dead and she was able to crawl out of the woods and get help.

Upon his conviction in 1991, a DNA sample was taken from Fleming and he was connected to the 1990 murder of 18-year-old Lisa Garland in Bangor.

Prosecutors believe Fleming randomly snatched Garland off the streets of Bangor, then raped, beat and strangled her and left her body in an Alton gravel pit. Her body was discovered one month later. He was convicted of the murder in 1995 and sentenced to life in prison.