The tough-as-nails cop who was shot in both legs in a gunfight on Brooklyn train shrugged off his injuries just a half hour after his attack, his father told The Post.

“He said he got shot and he’s OK,” said Stan Kozicki, of his son Lucasz.

The five-year veteran left Lutheran hospital in a wheelchair this afternoon and grimaced with pain as he was helped into an unmarked cruiser. Kozicki was shot in both legs by Peter Jourdan, 37, who has a record in California, including bringing a gun to court, drugs and intent to terrorize, law-enforcement sources said.

Michael Levay, who shot dead Jourdan after he allegedly pulled a gun on the train, was released from the hospital this afternoon. “[It’s] nice to be going home,” he said.

“Right now I feel great,” said his father, Bob. “I didn’t get any sleep last night, I’m so relieved it’s not even funny.”

The super in Michael Levay’s apartment said, “He’s our hero now. We feel good about him. He’s always very nice. I hope that he is going to be OK.”

Jason Marengo, 29, a yard manager at Boston Road Auto Mall, said he showed two of the alleged robbers a black 2001 Nissan Maxima.

“Once we got into the office, he tells me, ‘this is not a joke, this is a stickup.’ He told me to get on the floor,” he said.

“He told me to sit on the floor, to give him my money, my cell phone, you know, everything that we had in our pockets, so I did.”

One of the men ordered him and a customer to the floor, and ordered them to look at the floor, he said.

“He told me to get under my desk,” he said.

His accomplice found zipties used to tag car keys while rifling through drawers at the shop, and used them to bind Pichardo and the customer, he said.

“Once he ziptied Juan, he started going through the drawers next to my desk,” he said.

Pichardo saw an opening to make a move — and was able to bust out of the zip tie.

“Juan saw the opportunity to take him, because he told Juan, if he don’t give him the combination for the safe, he was gonna kill him. That’s when Juan grabbed the opportunity to grab him,” he said. “When he tried to push him down, he shot Juan in the leg.”

Marengo said the gunman’s alleged accomplice was rifling through drawers and trying to open the safe. He ran out of the shop after the shot was fired.

Marengo said he gave chase, but he got away.

Marengo said he then ran to his car, grabbed a pair of handcuffs, and then returned to the office, and handcuffed the gunman that Pichardo was subduing.

“We told him, ‘Listen, we law enforcement, you got the wrong people,'” he said

The Taurus 9-mm handgun used in the Brooklyn shooting was purchased in Allentown, Penn in 2011 and was not reported stolen, sources said.

The Bryco .38-caliber handun was reported stolen in Fayetteville, North Carolina in 2008, the sources added.