An alleged gang member initially charged with a misdemeanor assault for killing a man on a Brooklyn sidewalk with a single punch is now facing a felony, The Post has learned.

Prosecutors presented the upgraded second-degree assault charge to a grand jury sometime last month after The Post reported on the “one-punch loophole” that led to Joshua Hernandez’s initial misdemeanor rap. He was indicted on the more serious charge Dec. 19, court records show.

The Brooklyn DA’s office said it upgraded the charge “based on additional evidence that was recovered.

“We still believe, however, that a legislative fix is needed to address assaults such as this that result in death,” a spokesman said, noting prosecutors’ previous calls for legislation to eliminate the “one-punch loophole.”

Hernandez’s new charge comes with a maximum penalty of seven years behind bars, while the misdemeanor charge carried a one-year max.

The family of victim Jose Zambrano Rodriguez, 26, decried the failure of the justice system in an emotional interview with The Post last month that sparked a public outcry.

Now we have a murderer thug roaming the streets of NYC because of this bulls–t law. This brings no justice for the family of this young man,” Twitter user @CarlosG_99 posted.

If you hit a person that is not prepared to defend themselves, you’re trying to kill them. If you shoot at a person, you’re trying to kill them. These laws are wacky. It’s not assault, it’s attempted murder and murder. Smarten up,” @thewidowsson2 weighed in.

Rodriguez suffered the mortal blow on Nov. 17, when Hernandez, a 25-year-old alleged Latin Kings gang member with a rap sheet that includes assaulting a cop, punched him on a Brooklyn sidewalk, police said.

Rodriguez and his female companion had just left the Mezcaleria La Milagrosa before 5 a.m. when Hernandez and his two friends asked the pair for a cigarette. Rodriguez said he didn’t have a smoke and the group moved on, but minutes later Hernandez snuck up from behind, connecting his fist with Rodriguez’s skull, according to Rodriguez’s sister, Pamela Zambrano Gomez, who claimed to have spoken to a witness.

Rodriguez fell straight to the ground, cracking his cranium on the pavement.

The Venezuelan native and aspiring video game developer was rushed to emergency surgery at Bellevue Hospital, where he fell into a coma. He was on a ventilator for four days before Rodriguez’s family made the gut-wrenching decision to take him off of life support.

What happened in Brooklyn Criminal Court two days later did little to bring the family solace: Hernandez was charged with only third-degree assault, and released on $20,000 bail.

Legal experts say the misdemeanor is not an unlikely charge for a “one-punch” killing.

“The bottom line is — was there intent to cause physical injury? Or serious physical injury?” said Jeremy Saland, a criminal defense attorney and former Manhattan prosecutor.

But the legal standard does little to achieve justice, family and friends argued.

“What frightens me the most is the possibility of the system making him go to prison only a year,” Rodriguez’ father, José Zambrano, had told The Post. “Because of a one-punch law.”

“The attacker didn’t punch Jose in the arm. He didn’t shove Jose. He put all of his anger, all of his strength, and all of his weakness behind a closed fist and aimed for Jose’s head,” Rodriguez’s friend, Matthew Onorato, wrote in a recent blog post on Medium.com.

Hernandez is scheduled to be arraigned on the second-degree assault charge Monday in Brooklyn Supreme Court.

Saland noted that the lesser third-degree assault charge could still be in play in a jury trial: “If the intent was not serious physical injury, and prosecutors can’t prove beyond a reasonable doubt otherwise, then the misdemeanor can only stand and the felony will fall,” he said.

Rodriguez’s family, meanwhile, is still fighting for an even stiffer penalty.

“There is no justice if he is not charged with homicide. There is no justice still with just a felony. My son is dead because of an attacker,” Zambrano said. “He was killed.”