PHILADELPHIA (AP) _ A man who spent nine years in prison for crimes he said he did not commit walked out of court a free man after a jury acquitted him in a new trial on rape and murder charges.

The courtroom remained hushed for several moments Friday after the jury foreman declared that Miguel Rivera had been found innocent of the rape, murder and conspiracy charges.

Rivera, 39, standing and facing the jury, broke the silence by quietly saying, ''Thank you.''

Then he sat down at the defense table and put his face in his hands as his attorney, Peter C. Bowers, patted his shoulder.

The Common Pleas Court jury deliberated five hours before reaching a verdict in the three-week trial.

Rivera had been convicted of participating in the June 27, 1973, drowning of Kevin Wolf, 18, in a pool beside the steps of the Philadelphia Art Museum and the rape of Wolf's girlfriend.

He and five others were charged, but one defendant, Juan Garcia, agreed in 1974 to testify against Rivera and the others in exchange for a reduced sentence. All, including Rivera, were convicted in separate trials on the basis of Garcia's testimony.

However, one defendant was set free in 1979 after evidence showed that he was in Puerto Rico when the killing and rape occurred. The other three men are still in prison.

Rivera was granted a new trial in 1983 after Garcia recanted his earlier testimony and evidence was unearthed that had been concealed by police and prosecutors in 1974.

But this year, Garcia disavowed his recantation, once again telling prosecutors that he and Rivera had participated in the crimes. He took the stand against Rivera in the second trial but was the only witness to place Rivera at the scene.

Rivera always has contended that he was in his neighborhood looking for his wife during the time the attack took place. Three witnesses who did not testify at the first trial said they had seen Rivera or been with him in the early morning hours that day.