A Prince George's County Circuit Court judge reversed himself yesterday and changed a death sentence to life in prison for Donald T. Maziarz, convicted last year of the brutal rape and murder of an Oxon Hill woman.

According to the new ruling by Judge James Magruder Rea, Maziarz, 22, must serve life in prison and will not be eligible for parole consideration for 25 years. Maziarz was the second person to be sentenced to death in Prince George's since 1978, following convicted murderer Kenneth Lodowski, whose trial and sentencing were overturned by the court of appeals.

In February 1984, Rea found Maziarz guilty of raping, robbing and murdering Peggy Naomi Green, 30, in November 1982. Green was left tied on the balcony of her apartment, which was then set on fire. According to testimony, Maziarz, of Hillcrest Heights, and a friend met Green at a liquor store and were invited to her apartment for a small gathering.

During a lengthy sentencing, three defense lawyers introduced evidence of Maziarz's traumatic childhood. He was bounced from one foster home to another, according to testimony, and was sexually abused by his brother and by a foster parent who practiced witchcraft.

Under state law, the sentencing judge must weigh the aggravating circumstances of the crime against mitigating factors. The appeals court opinion said that the death penalty should not be imposed if the mitigating factors outweigh the aggravating ones only slightly.

Rea had sentenced Maziarz to die in Maryland's gas chamber after finding that the murder was committed in concert with arson, another felony.

Rea had said that that aggravating factor was not outweighed by several mitigating ones including the fact that Maziarz was under 21 when the crime was committed, that he is partially impaired by a mental disorder and that he was not solely responsible for Green's death. (A second man, Kevin Bennett, was also convicted in Green's murder. He was sentenced to two life sentences plus 10 years.)

Defense attorneys argued to Rea and later to the appellate court that the mitigating factors in the case clearly outweighed the aggravating.

Last December, the Maryland Court of Appeals agreed unanimously to reverse Maziarz's death penalty, saying that Rea had interpreted the state's death penalty law too harshly. The court returned the case to Prince George's Circuit Court for reconsideration of the sentence.

"We're obviously pleased," Prince George's chief public defender, James Kenkel, said yesterday of Rea's decision. "The only thing to do was to apply the standards properly and that dictated a sentence of life."

Assistant State's Attorney Carl W. Buchheister said yesterday that once the appeals court vacated the death sentence, another sentencing trial could have been held. Instead, the state withdrew its death penalty request in exchange for an agreement from the defense that Maziarz be sentenced to life in prison without an opportunity to be considered for parole for 25 years, Buchheister said.