Atibi Thomas said he was fleeing a gunfight with robbers and running to call police when he met Atlanta Police Officer Keith Roach.

Roach, who had just gotten off duty that afternoon of May 29, 2010, was driving by when he saw Thomas firing his gun wildly on an Atlanta street. The officer leaped from his SUV, gun drawn, to arrest Thomas.

“I remember him saying, ‘Police, get down,’ ” Thomas told a jury this week at Fulton County Superior Court.

Thomas started to comply. But while on the ground, as Roach started to handcuff him, Thomas said he began to think Roach was actually a robber impersonating a policeman because he saw Roach get out of a black SUV and saw tattoos on the officer’s arms.

“I pushed up and I think we kind of broke apart; his gun went off,” said Thomas, a 32-year-old Lithonia merchant. “As I turn around, I see his gun pointed at me and I started shooting.”

If Thomas had let himself be handcuffed, he probably would have spent some uncomfortable minutes in custody and then been released to make a crime-victim report.

Instead, he’s now on trial, charged with attempted murder of Roach and facing a maximum sentence of 25 years.

Thomas, who has been out on bond during the nearly three years since the shooting, spent Thursday and Friday trying to persuade a jury that it was “reasonable” for him, in an adrenalin-charged, fear-laden moment, to conclude Roach was impersonating an officer.

Jurors will return to court to deliberate Monday.

Prosecutor Yolanda Mack argued Thomas’ guilt is obvious.

“You shoot an officer in the chest, in full uniform head to toe, empty your clip … and you’re guilty of aggravated assault on a police officer, criminal attempt to commit murder,” she said. “We can’t have people putting bullets into police officers.”

She noted other witnesses — including those who rescued Roach from Thomas — knew Roach was a cop.

But defense lawyer David Wolfe told jurors something else should be obvious: Thomas isn’t the type of guy who goes around shooting cops. He has no criminal record, he worked in his father’s foreign car shop in DeKalb County, he had just recently received a mathematics degree with the goal of becoming an actuary — and he had a permit for his .357-caliber Glock pistol.

A series of character witnesses testified to the defendant’s honesty and decency.

“He was wrong. Roach was wrong,” Wolfe said. “Did he commit a crime? No.”

Mack countered that jurors could conclude Thomas was engaged in a “shady deal” at the time of the shooting. The prosecutor even suggested Thomas wasn’t in a gunfight with robbers, even though police later arrested one of the suspects with a bullet in his leg and indicted him and another man for robbing Thomas.

“A drug deal? Is that what the state is trying to infer, that a drug deal was going on? Don’t you think that would have come out in the investigation?” Wolfe asked. “He was a reasonable man doing a reasonable day’s work and he just about got killed.”

Thomas testified that he had agreed to deliver four tires to Leland Cortez Sims and Darrlin Vernard Warner, who had just paid $2,000 for them at his father’s store. The delivery was to take place in the West End neighborhood of Atlanta.

According to a police investigation, another man, Dontavious Marquess Berry — who’d just gotten out of prison — had been recruited to rob Thomas when he delivered the tires, as the men mistakenly believed Thomas had the $2,000 on him.

Thomas said he became suspicious when driving to Atlanta and insisted the men pick up the tires at a service station off the Lee Street exit of I-20.

Thomas, who had his pistol, said he shot Berry after being confronted with a revolver and then fled, firing back at the robbers and running up to a restaurant, where he asked a woman to call the police.

Roach then stopped him. Thomas said he saw tattoos on the officer’s arms that he thought were similar to those on one of the robbery suspects, and that led him to conclude Roach was a robber too.

Which man fired first is a matter of contention, but Thomas emptied his final three shots into Roach, fracturing the officer’s rib and wounding both of his arms. One bullet shattered a cellphone in a vest pocket above the police officer’s heart.

Roach’s bullet-proof vest saved his life — and saved Thomas from a murder charge.