The four men embroiled in the shooting of an off-duty Bronx cop during a botched robbery were arraigned on attempted-murder charges yesterday — and the alleged shooter showed up in court sporting black eyes and stitches.

The men accused in the crime that wounded Officer Juan Pichardo — Tyquez Harrell, 22, of Brooklyn; Jeffrey Okine, 22, of Mount Vernon; and Marquis Daniels, 23, and Rayshaun Jones, 25, both of The Bronx — were also slapped with assault and robbery raps.

The 41st Precinct officer had bravely subdued Okine — who reportedly told prosecutors he was the gunman — after he was shot Thursday when the four men allegedly tried to rob a used-car dealership on Boston Road in Laconia.

In court yesterday, Okine had stitches on his mouth and forehead, staples on his face and two black eyes.

“Okine was hit as he was being subdued and disarmed by both Officer Pichardo and a dealership employee,” said NYPD spokesman Paul Browne.

Jones’ wife, Tamiko Jones, 36, claimed officers pummeled Okine and he “gave up the names of the other three and told police where they were.”

Okine is being held on $300,000 bail, Jones and Harrell on $250,000 each, and Daniels on $100,000.

Meanwhile, Pichardo was released from Jacobi Medical Center in a wheelchair to a chorus of bagpipes and applause from about 100 cheering colleagues and friends.

“I’m feeling good,” said Pichardo, 34, as he was taken to a car for the trip home.

Pichardo’s friends and fellow cops rejoiced at his hospital release.

“He’s happy to be out, and he’s happy to see his children,” said one pal.

Lt. Neftali Betances, of the 41st Precinct, said Pichardo was “lucky” for surviving and getting out of the hospital so soon.

“The last thing we want is to lose an officer,” he said. “He’s recovering well. The family and he are in high spirits.”

Another friend told The Post that Pichardo hadn’t expected friends and fellow cops to line the hallways of Jacobi and the street outside.