A D.C. Superior Court judge declared a mistrial Friday in a 2008 murder case and allowed the defendant to fire his New York-based attorney, who exhibited what the judge said were numerous signs that he lacked knowledge of proper trial procedure, including telling the jury during his opening statements that he had never tried a case before.

Judge William Jackson told attorney Joseph Rakofsky during a hearing Friday that he was “astonished” at his performance and at his “not having a good grasp of legal procedures” before dismissing him.

What angered Jackson even more was a filing he received early Friday from an investigator hired by Rakofsky in which the attorney told the investigator via an attached e-mail to “trick” a government witness into testifying in court that she did not see his client at the murder scene.

According to the filing, Rakofsky had fired the investigator and refused to pay him after the investigator refused to carry out his orders with the witness. The filing included an e-mail that the investigator said was from Rakofsky, saying: “Thank you for your help. Please trick the old lady to say that she did not see the shooting or provide information to the lawyers about the shooting.” The e-mail came from Rakofsky’s e-mail account, which is registered to Rakofsky Law Firm in Freehold, N.J.

After the hearing, Rakofsky, 33, declined to comment on the case as he rushed down the escalators and out of the courthouse.

Rakofsky’s Web page on lawsearch.net says he specializes in criminal law, DUIs, traffic law, malpractice law and negligence. He lists his firm’s address as 14 Wall St. in Manhattan, but the New York state attorney registration offices have no record of Rakofsky being licensed in New York. Rakofsky, who received his law degree from Touro College in Brooklyn, N.Y., in 2009, has been licensed in New Jersey since April 29, 2010.

Confusion between Rakofsky and his client began early in the case and escalated, according to sources familiar with the case, U.S. v. Dontrell Deaner. Deaner, 21, of Southeast Washington, was charged with six counts involving the fatal shooting of Frank J. Elliott, 41, in the 4200 block of Pitts Place SE on June 16, 2008.

News of the mistrial spread throughout the courthouse as observers raced into Jackson’s third-floor courtroom Friday to watch the proceedings. The judge, now obviously angry and frustrated, told Rakofsky that his performance in the trial was “below what any reasonable person would expect in a murder trial.”

“There was not a good grasp of legal procedures of what was, and was not, allowed to be admitted in trial, to the detriment of Mr. Deaner,” Jackson told Rakofsky.

Jackson said the most evident sign of Rakofsky’s inexperience came during his rambling opening statements before the jury Wednesday, which lasted more than an hour, more than 30 minutes longer than most attorneys’ openings. During his opening statements, Rakofsky repeatedly made reference to children playing “in the projects of Southeast D.C., where there was always gambling, guns and drugs.”

“There are drugs in the projects of Southeast D.C. There are guns all the time and drugs,” Rakofsky told the jury.

The prosecutor repeatedly objected over the relevance of Rakofsky’s statements. Rakofsky said the “children” were a symbol of what his client had endured growing up in that neighborhood. Jackson told Rakofsky to focus on the case, especially because none of the “children” he referred to was scheduled to testify.

Later during his statement, Rakofsky informed the jury that the case was his first trial. The revelation shocked Jackson, the judge revealed at Friday’s hearing. “I was astonished someone would represent someone in a murder case who has never tried a case before,” the judge said.

Rakofsky did not speak during Friday’s hearing.

On Thursday, Deaner became visibly frustrated with Rakofsky’s performance after witnessing disagreements between Rakofsky and Sherlock Grigsby. Grigsby is a Washington-based lawyer who Rakofsky hired as local counsel to advise him on D.C. law practices during the trial because Rakofsky is not licensed to practice in the District. On Friday, Deaner told the judge that he wanted a new attorney.

After Friday’s hearing, Grigsby said that Deaner’s family hired Rakofsky and that he and Rakofsky “disagreed more than a couple of times” on how to proceed with the case. “He was the attorney of record. I would offer what I thought was the best advice, and he wouldn’t accept it,” Grigsby said.

Jackson said he would appoint a new attorney for Deaner. Jurors were called and told not to report Monday, and a follow-up hearing was scheduled for April 8.

Deaner will remain in the D.C. jail until his next trial, which could take as long as a year.

News researcher Jennifer Jenkins contributed to this report.