Updated

A judge in Alaska approved terms of a settlement that throws out the longstanding convictions of four indigenous men in the 1997 beating death of a teenager in Fairbanks.

The so-called Fairbanks Four accepted the deal during an unscheduled hearing in Fairbanks, the Fairbanks Daily News-Miner reported (http://is.gd/cdv2Er). One man has already been released on parole. The agreement calls for the release of the other three, and it bars all four from suing government entities.

Judge Paul Lyle ordered the men be taken to the Fairbanks Correctional center to be immediately released. About 150 supporters had crowded the courthouse for the hearing, and many cheered inside the small courtroom cheers as Lyle exited for his chambers.

The three Alaska Native men and an American Indian — George Frese, Kevin Pease, Eugene Vent and Marvin Roberts — maintained their innocence in the death of 15-year-old John Hartman. Alaska Native leaders have long advocated for their release, saying the convictions were racially motivated and emblematic of how Alaska Natives have been treated by the justice system. Roberts was the only man on parole.

The state continued to vigorously defend the convictions through a civil trial, which ended in early November. But it made a surprise offer last week to free the three men who remained behind bars.

Attorney General Craig Richards' office said later Thursday that the outcome wasn't an exoneration.

"In this settlement, the four defendants agreed they were properly and validly investigated, prosecuted and convicted," the office said in a news release. " This compromise reflects the Attorney General's recognition that if the defendants were retried today it is not clear under the current state of the evidence that they would be convicted."

In the same statement, Richards acknowledged that "some individuals will be understandably upset by this decision." But he said that he believes the " resolution of this matter at this time is in the state's best interest."

Hartman's brother, Chris Kelly, testified by phone at the hearing, voicing his objections to the deal. After the hearing, Kelly told The Associated Press he was flabbergasted at the outcome, saying only guilty people would have accepted such an agreement. If the men are truly innocent, he doesn't see how the state could treat them that way, and if the men are guilty, the state made a deal with murderers, Kelly said.

"I can't believe it," he said. "I feel like my family is completely wronged."

The deal was reached as the judge considered a verdict in the separate civil action from the men seeking to have their convictions overturned.

"I'm glad there was a process available to the Fairbanks Four where all involved could arrive at a mutually acceptable agreement," said Alaska Gov. Bill Walker in a statement. He had been considering pardons for the men.

"I hope this settlement helps to begin the healing process, and provides some measure of justice and closure for Eugene Vent, Kevin Pease, George Frese and Marvin Roberts as they return home to their families," Walker said.

"Justice prevails!" U.S. Sen. Lisa Murkowski, R-Alaska, said in a statement. She had previously asked the state of Alaska to examine whether the convictions were just and the U.S. Department of Justice to determine if there were civil rights violations in the case.

State Rep. Scott Kawasaki, D-Fairbanks, said in a statement he was pleased the men will be able to join their families for the holidays.

"The wounds of this case will eventually heal, but it will take time," Kawasaki said. "It is unfortunate to see that the Fairbanks Four had to settle for a deal like this rather than see justice done, but I emphasize with the desire to be free and with family."

The Tanana Chiefs Conference, a tribal nonprofit organization that supports the Fairbanks Four cause, tweeted Thursday afternoon that its executive board was holding its meeting at the courthouse instead of its offices.

The case against the four was always fraught with complexities. Some of the men confessed to the murder and then recanted, saying they were drunk. Other witnesses had said they were coached by police.

The Alaska Innocence Project advocated for the men, and sought post-conviction relief in civil court. The group's case was based on the recollections of a Fairbanks man now in prison for murder in California.

William Z. Holmes Sr., who was a senior at Lathrop High School in Fairbanks in 1997, said he was present when Hartman was fatally beaten by a group of four of his Lathrop classmates. He testified about his memories, and he attributed quotes to a friend over the objections of state prosecutors, who said that was hearsay.

Lyle heard the civil case for weeks, and he said he planned to issue his decision in the civil proceeding sometime next year.