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 dog owner forked out £1,200 in vet bills after his Terrier ate 24 rubber gloves used for tending to his allotment.
More than two million spectators cheered on this year’s Tour de Yorkshire. The county has been referred to as the 'heartland of cycling'.
Two men who died when their plane crashed into a remote field are thought to have been RAF pilots.