A Chinese crime writer who allegedly used murders he committed as inspiration for his novels was sentenced to death, according to reports.

Liu Yongbiao, 53, received the death penalty Monday in a cold case that went unsolved in Huzhou for nearly two dozen years, the Daily Mail reported.

The acclaimed author and an accomplice reportedly killed a couple and their grandson during a robbery in November 1995 at their family-owned hostel.

Authorities said the pair killed the family to cover up the murder of one of the guests.

The slayings stumped authorities for 22 years due to lack of surveillance cameras at the hostel, according to the Daily Mail. Police were able to finally make a break in the case last year after using DNA evidence from a cigarette at the crime scene.

“I’ve been waiting for you all this time,” Liu told officers when he was arrested in August 2017 at his home in China’s Anhui province.

Liu later admitted in an interview that the gory details in some of his novels were based on the killings.