Officer Juan Pichardo, 34, was released from Jacobi Medical Center Saturday, two days after the shooting at his family’s used car business. Pichardo was off duty at the business when two men attempted to rob it, police said.

Pichardo was shot in the thigh before he and an employee were able to subdue one of the men and grab the gun, police said. The second suspect took off and jumped into a white Impala with Oregon license plates that had two other men waiting inside.

Police said Pichardo was able to hold the gunman until responding officers arrived. The second suspect as well as the two others in the getaway car were arrested a short time later, police said.

Pichardo had recognized the gunman as a member of a Bronx robbery crew, Kelly said. The suspect’s gun had been reported stolen from North Carolina last month, he said.

The suspects have been identified as Jeffrey Okine, 22, of Mount Vernon, Marquis Daniels, 23, of the Bronx, Tyquez Harrell, 22, of Brooklyn, and Rayshaun Jones, 25, of the Bronx. They have all been charged with attempted murder, assault, burglary, robbery, criminal possession of a weapon, criminal use of a firearm, menacing and criminal possession of stolen property.

Harrell and Jones each face an additional charge of unlawful possession of marijuana.

In a separate incident Thursday, two plainclothes officers – Michael Levay and Lukasz Kozicki – were shot multiple times while working undercover on the subway in Brooklyn.

Both officers came face to face on a Manhattan-bound “N” train with suspect Peter Jourdan, who had an extensive criminal record and was about to be given a summons for passing from car to car, police said.

When they asked the man for identification, he stood up as if to cooperate but instead pulled a 9mm Taurus handgun from his waistband and opened fire, Police Commissioner Ray Kelly said.

Kozicki was shot in each of his upper thighs and once in the groin. Levay was shot in the back, but was able to return fire and killed the gunman, Kelly said.

Jourdan, 37, of Allentown, Pa., had been arrested at least seven times, including once in Los Angeles for bringing a gun to court.