KNOXVILLE, Tenn. (AP) _ An abortion protester who faced no more than 30 days in jail but wound up spending a year behind bars because he wouldn't give his name has been released, his identity still in question.

''I did what I think was right,'' the man, who has identified himself only as Baby John Doe, told Judge Randall Nichols at a hearing Tuesday in which he won his freedom.

Nicholls ordered the protester, who had been in custody since his arrest exactly year ago for blocking the doors to a Knoxville health clinic, to pay $12,547 to the county for the cost of jailing him.

The protester said he hoped his demonstration to make abortion illegal in Tennessee had advanced his cause.

''Maybe not (with) the Legislature,'' he said, ''but the hearts of some people.''

The protester was charged with criminal trespassing after refusing to leave the clinic during a protest by the anti-abortion group Operation Rescue. The charge carried up to 30 days in jail.

Nichols convicted him in September but refused to impose the sentence until the man, who was booked as Baby John Doe and is reportedly 25 years old and from out of state, identified himself.

On Tuesday, Assistant District Attorney David Jennings recounted his office's unsuccessful efforts to determine the man's identity and said a guard at the penal farm where the man was held told authorities his name might be Gary Christopher.

When asked if that was his name, the protester said, ''I cannot comment on that, sir.''

The judge agreed to release the man under the names Baby John Doe and Gary Christopher, saying his decision was affected by nightly questions from his 8- year-old son on the protester's fate, letters from all over the United States on his behalf and overcrowding in the county jail.

Asked how the court will be able to track down the man if he fails to pay the $12,547, the judge said it was a valid question. ''I would hope to be able to use the powers of the state of Tennessee to find out,'' he said.