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
North east receives its first life sized childbirth simulators
A major sea rescue mission sees a man saved at Hendon. It is thought he had been fishing from the promenade.
New Metro fares in 2016 will mean a rise in the cost of daysavers, and a reduction in single fares