A gunman in a magenta hoodie opened fire at an L train station last Thursday in Brooklyn, authorities said.

The victim bizarrely took a cab home and went to sleep before waking up the next morning and realizing that he had been shot, according to law enforcement officials.

The alleged shooter wounded the 35-year-old man in the right leg shortly before 12:50 a.m. at the Livonia Avenue stop near Van Sinderen Avenue, and then he fled.

The victim flagged a passing cab near the subway station, took it home and fell asleep, the law enforcement officials said. When he woke up, he saw that his shin was bleeding and went to Brookdale Hospital, where he was treated for the gunshot wound. The victim hasn’t been cooperating with police, officials added.

Surveillance footage revealed that the assailant is in his twenties, and is between 5-foot-6 and 5-foot-8 inches tall. He wore a white T-shirt with the magenta sweatshirt, as well as jeans, authorities said on Wednesday.

Any tipsters with information about the gunman who opened fire at the L train should call Crime Stoppers at 1-800-577-TIPS, or visit nypdcrimestoppers.com. People with information can also text the NYPD at 274637, and then enter TIP577.

The police investigation snagged service on the L train, and two southbound trains were late, transit documents show.

L service was suspended between Broadway Junction and Rockaway Parkway in both directions shortly before 1 a.m.

Normal subway service returned at about 1:20 a.m. after police finished the investigation at the Livonia Avenue station.