SANTA MONICA, Calif. (AP) _ A racial slur allegedly made to a friend and jailhouse letters written by the man accused of killing Ennis Cosby may be used as evidence of a confession, a judge says.

Over defense objections, Superior Court Judge David Perez agreed Wednesday to let prosecutors use the purported comment by Mikhail Markhasev, as well as letters he allegedly wrote in jail. Jury selection for his trial begins June 16.

Cosby, son of entertainer Bill Cosby, was shot Jan. 16, 1997, while changing a flat tire on a roadside. Markhasev, a 19-year-old Ukrainian immigrant, was arrested nearly two months later.

The judge said prosecutors may introduce the racial statement if they call the friend as a witness to testify about it.

According to prosecutor Anne Ingalls, Markhasev told friend Michael Chang: ``I shot the nigger. It's all over the news.''

Deputy Public Defender Henry Hall said use of the word would be inflammatory and told reporters outside court that prosecutors were trying to bring up the language to hide weaknesses in their case.

``The prosecution's motive throughout this entire case has been that it was an attempted robbery,'' he said. ``For them to try to interject this race thing into it at this point seems to me to be reflective of some kind of concern that maybe it isn't what they thought it was.''

Hall also disputed the authenticity of the six letters he said were brought to authorities by an inmate identified as David Gomez. He said Gomez cannot be trusted because he has been convicted of attempted murder, is a perjurer, has a pending rape trial and wants leniency in his own cases.

``It's our position that Mr. Markhasev didn't write the letters,'' Hall said.

Ingalls argued that handwriting analysis proved the letters were written by Markhasev and that Gomez ``only acted as a conduit.''

The content of the letters were not revealed.

Court papers say Chang and another man, Christopher So, told police that Markhasev called Chang days after the slaying and asked for help in finding the gun he had thrown away the night of the shooting.

The three looked for the gun but could not find it, and So later reported the matter to police, according to the papers.