The teens didn't realize they were under police surveillance. Two of the teens donned masks and went into the gas station.

It was January 2009. Five convenience store clerks had been shot in a series of robberies. This time, police were ready.

The undercover officer tackled the third teen, the lookout. But he forgot his handcuffs. The teen tried to squirm free.

The detective looked up to see the other two teens running toward him, to the back of the store where they left their bikes. The one with the gun pulled the trigger, over and over.

Bullets slammed into his leg, his stomach and his chest. He fell over. He raised his mini-Glock and squeezed off seven shots, emptying the magazine. He missed. The teen was still aiming his gun. Sirens blared. Backup wasn't going to make it in time.

"He's moving around like he's trying to take a head shot," the detective recalled in an interview Monday. "You can see the gun moving and tracking me.

"Luckily through the grace of God I think he ran out of bullets."

All three teens ran. The detective lay bleeding in the alley. A husband and father to five, his prayers were not for himself.

"I'm thinking 'This is it,' " the officer said. "I'm shot too many times. I'm not going to make it.

"I was praying hard, praying for the Lord to take care of my family."

• • •

The detective survived that Jan. 26, 2009, shooting. After emergency surgery that night and several months of rehabilitation, he returned to the department in September 2009 and the same undercover unit.

Now, two years later, the officer says he can finally put the ordeal behind him.

James Allen Seay was 18 when he robbed the Exxon station at 3061 First Ave. N and shot the officer. He pleaded guilty Thursday to attempted murder of an officer and armed robbery and was sentenced to 25 years in prison. All three defendants are now serving time.

Had Seay, 20, been convicted at trial he could have been sentenced to life in prison without parole.

Yet the 43-year-old detective — whose name is being withheld by the St. Petersburg Times because he still works undercover — blessed the plea deal.

Seay will have to serve every day of his sentence. He'll be in his 40s when he gets out.

His victim, who was shot four times, who still has a slug in his thigh, who lost his gall bladder and a chunk of his liver to the round that pierced his lung and just missed his heart, said 25 years is enough.

The detective said he wanted justice, not vengeance.

"Even when this happened, I have never been hell-bent on vengeance," he said. "I thank the Lord that I survived and that I'm still here with my family. Whatever happens in the criminal case happens, but I wasn't out to bury him under the jail."

He doesn't want anyone to think he's "soft on crime." This is what's best for himself and his family:

"I don't want to sound like I'm trying to be Mother Teresa. I have my life. I thank the Lord I'm here for my wife and kids. And it's over. I know it helps me. I really don't want to relive it."

• • •

The detective also didn't want the trial to remind others of the Police Department's most recent pain: St. Petersburg Officers Thomas J. Baitinger, David S. Crawford and Jeffrey A. Yaslowitz were shot and killed in the line of duty earlier this year.

"These families have suffered so much," he said. "If we can do it without a public trial, that's one less thing the wives and families of the fallen officers have to see."

Since the detective was wounded, the Tampa Police Department also has lost David Curtis, Jeffrey Kocab and Mike Roberts — all shot to death in the line of duty.

Why did they fall, the detective wonders, while he lived?

"The whole survivor's guilt is a very real thing," he said. "I don't know how you deal with it. That's been very difficult."

In his worst moments, he fears the fallen officers' children may one day wonder: "Why is he here, and my dad's not?"