MIAMI -

A mistrial was declared Monday in the trial of a man accused of fatally shooting a Miami police detective in 2008.

The ruling was made after weeks of testimony in the trial of Andrew Rolle.

Defense attorneys said they did not properly get to depose a witness, who is also an alleged co-conspirator in another crime involving Rolle, before he took the stand.

The judge eventually agreed to a mistrial.

"We tried not to have a mistrial," prosecutor Abby Rifkin said. "We tried to try it once and just once, but unfortunately that happens and that's what happened here. It's best for all the parties involved -- for the defendant and the community -- to start this trial all over again and to do it right and to do it once."

Rolle claimed he was acting in self-defense when he killed James Walker.

Walker was off-duty and sitting in his unmarked Ford Taurus while visiting his ex-wife. Investigators believe Rolle mistook Walker's car for his getaway car. When Rolle was unable to open the car door, he shot the officer.

But the defense said it was an act of self-defense because Walker pulled out his gun first and Rolle didn't know Walker was a police officer.

The state is now pursuing a new trial. The judge said a new court date will be announced Wednesday.