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
Mike Ashley's Sports Direct has seen its half year profits dented. The retailer said that statutory pre-tax profits plunged 67.3%.
There are reports that the Mike Ashley era at Newcastle United will soon be over with the club reportedly close to agreeing a takeover.
Denise Welch has quit the Newcastle Times Square pantomime, Jack and the Beanstalk.