An FBI agent took the stand Wednesday at his accused shooter’s trial to describe the Dec. 2018 ambush that left him shot in the back — and convinced he was going to die.

“It felt like my back exploded,” special agent Christopher Harper told jurors seated on reputed Crips member Ronell Watson’s trial, recalling the moment a bullet tore into him and lodged in his left lung.

Asked by Brooklyn federal prosecutor Francisco Navarro to describe the shooting, Harper closed his eyes and said: “Gunshots, impact. The skin on my back breaking, and then it felt wet.”

A police officer in Philadelphia before joining the FBI, Harper had been on a covert assignment in Canarsie — staking out another suspect from his car — when Watson drove the wrong way down a one-way street and blocked him in with his BMW M5.

Watson then allegedly touched his belly and put his hand in his pocket as he walked toward the car — which Harper said convinced him he had a gun.

“My mind was going one hundred miles an hour,” Harper recalled, saying he decided to drive away instead of pulling out his own weapon to engage in a firefight.

But as he fled, the agent said he felt the impact of the slug in his back and decided to return fire, parking his car down the block and rolling out of his own Nissan Maxima to return fire.

“I could see glass breaking around him, I could see my bullets impacting his car,” Harper said of Watson, who had gotten back into his vehicle. The agent said he ran out of bullets just as Watson — who was shot in the hand — drove away.

The agent said he thought he’d been hit with multiple rounds, and was about to die.

“Do I have five seconds to live? Do I have 10 seconds to live?” he recalled asking himself. ‘My head started spinning like a whirlpool.”

“This is it,” he thought. “I’m gonna die.”

The bullet lodged in his lung, breaking a rib and his shoulder blade. Dr. Jeffrey Port, the cardiothoracic surgeon who removed the bullet, said the shot “absolutely” could have been fatal.

“I was really scared I wasn’t going to see my kids again,” Harper told jurors through tears.

Earlier Wednesday, jurors were escorted by U.S. Marshals to view the bullet-riddled cars, which had been brought to the courthouse as evidence in the trial.

During Harper’s testimony, jurors were also shown the red sweatshirt the agent had been wearing during the shooting — complete with bullet-hole and bloodstains.

Watson’s attorneys claim he opened fire after the Nissan started barreling toward him, and he panicked.

He’s charged with attempted murder of a federal officer, assault of a federal officer and possessing and discharging a firearm during a crime of violence.

If convicted, Watson faces up to life behind bars.