A suspect accused of trying to rob a security guard in Northwest Miami-Dade, who was injured alongside another suspect after gunfire was exchanged, appeared before a judge on Tuesday.

Javarus Hernandez, 20, was charged with armed robbery with a deadly weapon, attempted armed carjacking, and attempted felony murder.

Hernandez on Tuesday appeared in court remotely from his hospital bed as he recovers from his injuries.

During his appearance, a judge denied Hernandez’s bond.

According to the Miami-Dade Sheriff’s Office, deputies on Monday responded to the area of Northwest 19th Avenue and Northwest 79th Street around 4 a.m. after receiving a ShotSpotter alert.

An arrest report said the victim, identified as a security guard, called 911 and said that he disarmed and was able to pin down one of the suspects involved in the shooting.

The suspect, who was taken down by the security identified as Fredrick Pickens, while Hernandez was found at a Church’s Chicken parking lot on 79th Street, the report said.

As detectives investigated the incident, it was revealed that both Pickens and Hernandez were casing the area of the apartment complex and were trying to get into possibly unlocked cars, the report said.

The security guard, the report said, was in the passenger side of his car when one of the suspects tried to open the driver’s side, which was locked. When the security guard confronted the two and asked what they were doing, Pickens and Hernandez pulled out their firearms and robbed the security guard.

As the security guard was held at gunpoint, the two searched him and his vehicle, and at one point, Pickens entered the driver’s side of the victim’s car, while Hernandez went to the back passenger side as they tried to leave the area, the report said.

The security guard, the report said, was able to disarm Pickens and fired several shots at him, and then got into a shootout with Hernandez, who fled the area on foot.

Detectives were able to track Hernandez after he left a trail of blood and had bloody footprints, leading them to the Church’s Chicken parking lot, the report said. He was then detained.

The report said that during the shootout, Hernandez suffered a gunshot wound to the back of his head. All three men were taken to the hospital for treatment.

Surveillance video at the apartment complex corroborated the security guard’s account of the incident, the report said.

Hernandez remains at the hospital.

Charges for Pickens were not released.