A teenager was arrested after confessing to a deadly stabbing in the heart of midtown Manhattan, according to a law enforcement source.

The 17-year-old suspect was caught by undercover officers hopping subway turnstiles at the Stilwell Avenue station in Coney Island, sources said. After checking his ID, the officers discovered that he was wanted for late Monday night’s fatal incident.

Police said they had responded to a call in front of a 43rd Street restaurant, Burger & Lobster Bryant Park, found the victim stabbed in the face, back, and chest. The victim was found just doors down from the Stephen Sondheim Theatre, which “& Juliet” currently calls its Broadway home.

The victim, who law enforcement sources say was homeless, was taken to a hospital in critical condition and later died of his injuries. Sources say he was seen arguing with someone shortly before the stabbing, less than a block away from the middle of Times Square.

The victim was identified Wednesday as 39-year-old Leonides Baez, of Worcester, Massachusetts.

The teen caught by police was brought to the precinct, where he confessed to the killing, according to law enforcement sources. He had a scalpel on him when they performed a search, sources added.

No information on charges had yet been shared, nor had the teen’s identity. Police initially said after the deadly stabbing that they were searching for three suspects, though there was no word on any other individuals who had been taken into custody in connection to the killing.

An investigation is ongoing.