It took nearly two decades, but the guilt of murder finally became too much for Trevell Coleman.

Wednesday night, after years of living with the burden, Coleman, 36, walked into the 25th Precinct and shockingly confessed to the very cold case, the sources said.

The career criminal — once signed to superstar rap mogul Shawn “Diddy” Combs’ record label — was just 18 when he fatally shot a Queens man outside an East Harlem housing project in 1993, police sources said.

“I shot and killed someone 17 years ago,” Coleman told a cop in the station house.

As Coleman continued to reveal more details of the Oct. 19, 1993, murder of John Henkel outside the James Weldon Johnson Houses — things only the killer would know — the officer reached out to investigators at the 23rd Precinct, where the crime took place.

“It was just eating away at him,” said a police source.

Coleman, who grew up in the projects, told cops he was riding a bike when he rolled up on Henkel, 32, on Park Avenue and East 114th Street and announced a robbery.

Coleman told Detective William Dunn that Henkel resisted and grabbed his .40-caliber gun.

He allegedly admitted that he pulled away and shot his victim three times in the chest.

Coleman said he fled and tossed the weapon into the East River.

Henkel was rushed to St. Luke’s Hospital, where he was pronounced dead.

When the detective reviewed the cold-case file, he was amazed to discover that Coleman’s tale matched up.

Coleman, who has racked up more than 25 arrests since 2003 for drugs, burglary and grand larceny, was charged with murder, and is being held without bail.

“My client is presumed innocent, and the case is going to grand jury,” said Coleman’s lawyer, Michael Alperstein.

Coleman, who rapped under the name “G-Dep,” was signed in 1998 to a $350,000, five-album deal with Combs’ Bad Boy Records. His first album, “Child of the Ghetto,” was released in 2001.

The song “Let’s Get It” featured Coleman trading rhymes with Combs and fellow Bad Boy artist Black Rob.

Coleman no longer has ties to the label, a spokewoman said.