A man’s quest to convince a judge to vacate his 1993 murder conviction based on newly-discovered evidence hit a snag Monday, when a Queens County prosecutor read a letter in court in which the man seemed to implicate himself.

Anthony Nwobi, 52, a Nigerian immigrant from Queens, has spent more than 21 years in prison for the murder of Justin Eze, his childhood friend. Nwobi has maintained Eze’s killer was actually Gregory Reece, the prosecution’s prime witness and owner of the home where the fatal 1992 shooting took place.

Nwobi has filed dozens of Freedom of Information Law requests to the New York City Police Department and Queens District Attorney’s Office, obtaining internal police memos and notes he says show police may have initially thought Reece was the shooter. In a motion to vacate his conviction filed in November, Nwobi alleged the Queens District Attorney’s Office never turned over those documents to his trial lawyer, William Jacobson, in violation of Brady v. Maryland, 373 U.S. 83 (1963) and People v. Rosario, 9 N.Y.2d 286 (1961). Jacobson is now deceased.

In a reply brief filed Monday, the district attorney’s office claimed it had given Jacobson all the documents it had. And in a hearing before Acting Queens County Supreme Court Justice Joel Blumenfeld (See Profile), Assistant District Attorney Robert Masters read from a 2009 letter Nwobi wrote to the detective who originally investigated the case.

“As I was shooting, Gregory was swinging my arms and one of the bullets accidentally struck my friend … and he died,” Nwobi wrote. William Kleinfelder, the now-retired detective, gave the letter to prosecutors on Friday, Masters said.

After the hearing, Nwobi’s attorney, Rita Dave, said she was aware her client sent a letter to the detective years ago but did not know its contents.

“You always have to gear up for some sort of battle,” she said.

Blumenfeld set a court date for June 13 but may issue a decision on the alleged Brady and Rosario violations before then.