Judy and Dennis Shepard tempered justice with mercy and may have spared the life of the man who killed their son.

In a dramatic and surprising end to the Matthew Shepard murder case, convicted killer Aaron J. McKinney, 22, today was sentenced to two life sentences for beating the gay University of Wyoming student to death last year. McKinney accepted a deal brokered by Shepard's parents just as a jury was about to begin hearing testimony about whether he should be put to death.

The unexpected agreement was announced this morning in the same Laramie, Wyo., courtroom where the seven-man, five-woman jury found McKinney guilty on Wednesday of felony murder, kidnapping and aggravated robbery. The panel was set to begin the penalty phase of the trial this morning, and McKinney's life hung in the balance.

It was 13 months ago that McKinney and an accomplice posed as homosexuals and lured Shepard from a bar, drove him to the outskirts of Laramie, tied him to a fence, savagely pistol-whipped him and left him to die.

"Mr. McKinney, I give you life in the memory of one who no longer lives," Dennis Shepard told his son's murderer in court this morning. Some members of the jury wept as he talked about a diminutive, trusting son who could see only good in others, who had nervously told his father he was gay, and who had "paid a terrible price to open the eyes of all of us" to the intolerance faced by the gay community.

And most poignantly of all, Dennis Shepard recalled in his lengthy statement the simple joys of fatherhood with a son--"my hero," he called him--now forever gone.

Earlier, McKinney had briefly addressed the Shepards, saying he was "truly sorry to the entire Shepard family," the Associated Press reported.

The sentencing agreement bars any appeal by McKinney and guarantees he will remain in prison for the rest of his life. It resulted from a request by McKinney's attorneys, Dion Custis and Jason Tangeman, to meet with the Shepards, whom the lawyers asked to spare McKinney's life, according to Albany County prosecutor Cal Rerucha and people close to the Shepards.

Judy Shepard agreed and went to the prosecutor to iron out the deal.

"To my knowledge it was Judy Shepard's decision," said David Smith, a spokesman for the Human Rights Campaign and an adviser to Judy Shepard as she has become a human rights advocate over the past few months. "I think it is the most stunning act of benevolence I've ever seen. In essence, Judy Shepard spared his life. It's a testament to her human spirit."

Rerucha, addressing the news media outside the Albany County Courthouse today, made it clear that if it had been up to him alone, there would have been no consideration shown to McKinney, who planned the attack. McKinney's accomplice, Russell Henderson, pleaded guilty on the eve of his trial last April in exchange for spending the rest of his life in the Wyoming Penitentiary.

"A real message was sent . . . by the Shepards," Rerucha said. "They lost what was most important to them, but they could look in the eyes of the man who took their son and give him mercy."

In his address to the jury, Dennis Shepard suggested he took some solace in the fact that his son spent his final night in Wyoming in the company of "lifelong friends": the night sky, "the smell of Wyoming sagebrush," the "ever-present Wyoming wind" and God. He then recounted his own feelings, and his late son's, about the death penalty.

His son, Shepard said, believed in the death penalty for certain crimes, and had called it justified in the racially motivated murder in Texas of James Byrd Jr., who was dragged to death behind a pickup truck in another hate crime that shocked the nation's conscience. "Little did we know that the same response would come about involving Matt," Shepard said.

"I too believe in the death penalty," he added. "I would like nothing better than to see you die, Mr. McKinney. However, this is the time to begin the healing process. To show mercy to someone who refused to show any mercy.

"Mr. McKinney, I'm going to grant you life, as hard as it is for me to do so, because of Matthew. Every time you celebrate Christmas, a birthday or the Fourth of July, remember that Matthew isn't. Every time that you wake up in that prison cell, remember that you had the opportunity and the ability to stop your actions that night. You robbed me of something very precious, and I will never forgive you for that."

CAPTION: In an unexpected move, Dennis Shepard, right, father of Matthew Shepard, who was killed last year, explains why he and his wife, Judy,