DALLAS (AP) _ Randall Dale Adams, who once was three days from execution for the slaying of a police officer, was freed Tuesday under a court ruling that he didn't get a fair trial.

''This is something I've dreamed about for 12 1/2 years,'' Adams said after the release order was cleared by some last-minute legal action. ''It's here, but give me a little bit of time to think about it.''

Adams, whose conviction was questioned in the documentary film ''The Thin Blue Line,'' said he was happy that two courts ruled in his favor but won't feel vindicated unless his name is cleared in a second trial.

''I still would like to have had the trial, but that's not up to me. That's up to the state of Texas,'' he told reporters.

Assistant District Attorney Winfield Scott said he intends to retry Adams for the 1976 shooting of Dallas patrolman Robert Wood, but may reduce the charge from capital murder to murder.

Adams had been ordered released on a $50,000 personal recognizance bond set Monday by state District Judge Larry Baraka. But prosecutors had tried to get Baraka removed from the case, saying he was biased in Adams' favor.

The prosecution succeeded in getting the bond raised to $100,000 cash surety late Monday, keeping Adams in prison another night. He had been in prison for more than 12 years.

Earlier Tuesday, Errol Morris, who directed ''The Thin Blue Line'' announced he would put up the money to meet the higher bond.

But District Judge Ron Chapman subsequently revoked the higher amount after talking to Baraka in chambers.

That cleared the way for Adams' release from the Lew Sterrett Justice Center without having to put up any money.

Adams plans to join his family in Grove City, a suburb of Columbus, Ohio, after a few days with his attorney, Randy Schaffer, in Houston.

He said he'll try to erase his family's pain and ''from there on I will try to be happy, and I think that will be easy to do.''

His mother, Mildred Adams, said her mobile home is decorated in anticipation of his return. ''I've got yellow ribbons up and signs that we love Randy, and welcome home,'' Mrs. Adams said.

In a related hearing, visiting state District Judge Carl Anderson cleared Baraka to hear the case should prosecutors decide to retry Adams for the 1976 killing of patrolman Robert Wood.

Adams was condemned to die in 1977, but the sentence was commuted to life in prison in 1980.

''The Thin Blue Line'' suggested the slaying was committed by the prosecution's chief witness, David Harris, who is on death row for another slaying but was not charged in the Wood killing. During a hearing in December, Harris recanted his trial testimony and told Baraka that Adams did not kill the policeman.

Based in part on that testimony, Baraka recommended that Adams' conviction be set aside and wrote a letter supporting parole.

The Texas Court of Criminal Appeals agreed, and on March 1 unanimously overturned Adams' conviction while allowing the indictment against him to stand.

Adams has said he's confident a new trial would vindicate him.

Baraka denied Tuesday that he was biased in Adams' favor. ''The whole thought of that (bias) is absurd. They're out there fighting for justice,'' he said. ''I did what was right.''

Scott, the assistant district attorney, insisted in court that he was confident that Adams was guilty.

''I know what all the evidence is,'' he said.

Under questioning, Scott said he had not read the Court of Criminal Appeals ruling that overturned Adams' conviction, nor Baraka's opinions. But he said it was clear that Baraka and eight of the nine appellate judges were liberal and biased toward Adams.