A 23-year-old Hyattsville man who has been imprisoned for three years for crimes that he denies committing was granted a new trial yesterday after another defendant in the case testified the man had had nothing to do with the crime.

Curtis Smith Jr. was sentenced in 1982 to life plus 30 years after being convicted of breaking into a house in Chillum, robbing its occupants and raping one of them.

Prince George's County Circuit Judge Vincent J. Femia, who heard the case and imposed sentence, ordered Smith released on a $10,000 bond yesterday, pending a newtrial. But Deputy State's Attorney Michael Whalen, who prosecuted Smith, said he is not sure that there will be another trial.

"The victimized family has gone through a lot," Whalen said. "Ihaven't talked to them yet to see what they wish to do."

Smith asked for a new trial last year, but Femia denied it because the key witness for Smith refused to answer questions at a hearing. Femia's ruling was reversed by the Maryland Court of Special Appeals.

The witness, Owen Marsh Jr., of Northeast Washington, had taken the Fifth Amendment on the ground that his testimony could be used to prosecute him on charges related to the crime. But the Court of Special Appeals, in reversing Femia, ruled that Marsh could not be charged anew for the crime.

Marsh testified yesterday that he and three other men had been joyriding one day in December 1981 and that he and the others -- Grady Sweet, Marsh's nephew Philip Yarborough and a man he didn't know, called "Bean" -- drank several six-packs of beer before Sweet parked the car on the street where the crime was committed.

Yarborough and Marsh pleaded guilty to theft, but neither received a prison term. Sweet, who pleaded guilty to three counts of armed robbery and using a handgun in the commission of a crime, was sentenced to 20 years.

"I couldn't stand to watch that guy do life for something he didn't do," Marsh, 28, said in an interview.

Fred R. Joseph, Smith's attorney, said he believes that his client would be acquitted at a new trial, based on Marsh's testimony.