The court heard that James Allen told a friend that he was dying of cancer on the night of one of the murders.
A friend of James Allen said that he took pity on him, and offered him somewhere to stay the night.
Allen is accused of murdering a pensioner in Middlesbrough last April, as well as a woman in Whitby.
The trial continues.
More top news
A look ahead at the Bank Holiday forecast for the Tyne Tees region.
Do you want to Leave or Remain in the European Union? That's the question facing everyone in the country. But what do young people think?
Remain or Leave? The impact on agriculture in the North East