A police officer in southern Virginia fantasized about being involved in shootings before going on to kill two unarmed men, prosecutors claimed on Tuesday.

Stephen Rankin, who is on trial for murder after fatally shooting an unarmed black 18-year-old last year, allegedly described his fantasy while he was employed as a police officer by the city of Portsmouth.

Prosecutors surprised Portsmouth circuit court on Tuesday by announcing that they intended to call Rankin’s ex-wife, Cori Johnson, to testify about statements that she alleges Rankin made during their marriage.

“The statements are that this defendant fantasized about line-of-duty shootings,” said the assistant commonwealth’s attorney Brandon Wrobleski, who added that the remarks were made in 2008 and 2009 “in the presence of several third parties”.

The prosecutors made their move after Rankin testified for several hours on Tuesday about his deadly shooting of William Chapman during a confrontation in a Walmart parking lot on 22 April last year. Chapman was suspected of shoplifting and Rankin had tried to detain him.

Denying charges of first-degree murder and illegally using a firearm, Rankin said that he shot Chapman as a last resort and in self-defense after Chapman charged at him following a struggle. “I felt I needed to save my life,” Rankin told jurors. He said at another point: “I didn’t want to hurt him at all. I certainly didn’t want him to pass away.”

Rankin, who was trained in mixed martial arts during a five-year stint in the US navy, argued he was forced to shoot Chapman because he “wouldn’t have been able to win an unarmed fight” against the 18-year-old. “This is as dangerous as things get out there,” he said of their confrontation. At 5ft 8in, Chapman was two inches shorter than Rankin. He weighed 187lbs with his clothes on; Rankin said he weighed 160lbs at the time.

Rankin had shot and killed Kirill Denyakin, an unarmed hotel cook, four years before his confrontation with Chapman. At the time he said Denyakin, 26, had reached into his waistband and charged at the officer during a confrontation outside an apartment building where Denyakin was banging loudly on a door. Denyakin was shot 11 times. A grand jury declined to bring charges. Rankin was terminated from his job after being indicted for murder in the Chapman case.

The trial of a white officer for shooting a young black man has played out amid an ongoing nationwide controversy over the use of deadly force by police against African Americans. The case has also pitted two senior black prosecutors against Rankin’s two attorneys, who are white. A third junior prosecutor is also white.

On Tuesday, Rankin insisted that Chapman’s race was not a factor in his decision to open fire. “It would have been the same with any person of any race or any gender,” he said.



Under questioning from his lead attorney, James Broccoletti, Rankin described how he shot Chapman just one minute and two seconds after radioing his dispatcher to say that he was approaching the 18-year-old in the Walmart parking lot following a 911 call from store staff at about 7.30am.



He testified that after he told Chapman: “I suppose you know why I’m here.” Chapman walked away briskly and allegedly put his left hand in his pocket. “I think he’s reaching for something and I need to detain him,” claimed Rankin.



After the officer apprehended Chapman and placed him over the hood of his patrol car, Chapman struggled and tried to get away. “Take your hand out of your pocket or I’m going to tase you,” Rankin said he told Chapman.



The officer claimed Chapman replied: “You’re not going to fucking tase me.” But commonwealth’s attorney Stephanie Morales played to jurors a video clip recorded by Rankin’s Taser in which she said Chapman could be heard asking: “You’re going to tase me when I didn’t do nothing to you?”



Rankin shocked Chapman with his Taser, using the close-contact “drive-stun mode”. He said this changed Chapman’s conduct dramatically: “Immediately he became enraged and he became very angry,” said Rankin. The Taser was knocked out of Rankin’s hand and the pair separated by about 6ft, he said.



The officer testified that he drew his Glock pistol and pointed it at Chapman, ordering him to get on the ground. But Chapman declined and instead taunted him. “Shoot me, motherfucker, shoot me,” Rankin recalled him saying, forcefully repeating the phrase several times throughout his testimony. Then, he said, Chapman “came towards me aggressively” and Rankin opened fire, striking Chapman in the face and chest. “I thought he was coming to kill me,” he claimed.



Across four days of testimony, the court has heard from the store security worker who called 911 that Chapman did not charge at Rankin, and from four construction workers who were building a convenience store nearby that he did, in fact, charge.



On Tuesday, Rankin was repeatedly drawn into tense exchanges during aggressive cross-examination by Morales, the lead prosecutor. “Please, ma’am, let me finish,” he said several times, as Morales tried to have him say that was not, in fact, forced to fire. Morales pointed out Rankin was left with “no marks on your face” and “no marks on your person”.



Rankin said he did not consider instead using pepper spray against Chapman, nor a baton that was in his car. Pepper spray is rated as a comparable weapon to the Taser under the “use of force continuum” in the Portsmouth police policy manual, he said, and once he had been disarmed and Chapman escalated the situation, he felt obliged to respond with a higher level of force.

After jurors were briefly sent out of the courtroom, Wrobleski told Judge Johnny Morrison that Johnson’s information about Rankin’s alleged fantasy was needed to rebut claims by Rankin during his testimony “that he did not want this to happen and did not want to kill Mr Chapman”.

But Morrison refused to allow Johnson’s testimony into the case after Broccoletti, Rankin’s attorney, argued that the alleged statements were made too long ago and were not relevant to arguments in the case about Mr Chapman’s death.

Asked earlier whether he had murdered Chapman, Rankin told jurors: “Absolutely not.” He said: “All I wanted to do was write him a ticket.”