BEIJING — As Liu Xiaobo, China’s most famous political prisoner, lay dying under police guard, he struggled to finish what was probably his last written work. It was not a political statement, but a sometimes playful, sometimes darkly cryptic, tribute to his wife, Liu Xia, an artist and poet who endured house arrest while he served an 11-year prison sentence.

“Love as intense as ice, love as remote as blackness,” reads one of the handwritten notes Mr. Liu wrote in a hospital in the northeastern city of Shenyang before he died of liver cancer on Thursday. “My praise is perhaps an unforgivable poison,” he wrote in the brief and sometimes fragmentary tribute to his wife and her art.

Mr. Liu’s notes were for the preface of an unpublished collection of his wife’s photographs provisionally titled “Accompanying Liu Xiaobo.” His notes and the photo collection were shared by a Chinese editor who was a friend of the couple and who had helped compile the book. The editor said Mr. Liu made contact late last month and that people close to Mr. Liu later passed on pictures of his notes from the hospital. The editor asked to remain anonymous, citing fear of repercussions.

Mr. Liu will remain best known as an obdurate dissident who was awarded the Nobel Peace Prize in 2010 while in prison. He was sentenced in 2009, the year after he helped issue a petition calling for democratic change that led to his arrest.