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
The number of landlords in the North East who plan to buy in the coming quarter has nearly doubled compared with a year ago
Hitachi Raul Europe is among the bidders hoping to win the £2.75bn contract to build 60 trains at its Newton Aycliffe site
A new look for our political programme from Westminster - Paul Brand and guests consider Theresa May's vision for Brexit.