A prisoner collapsed and needed emergency surgery after smuggling a stash of drugs and mobile phones into jail - hidden inside him.
David Amis needed his bowel opened up surgically after he was found unconscious in the exercise yard at Durham Prison last October.
Newcastle Crown Court heard surgeons found six bags, containing dozens of various drugs, two mobile phones, tobacco, metal and pieces of paper jammed inside his colon.
Prosecutor Shaun Dryden told the court: "He was found unconcious and unresponsive in the exercise yard by prison officers.
"He was conveyed to the local hospital by ambulance, where he was admitted.
"It became apparent he had a number of foreign objects concealed in his colon. Those objects had to be removed using surgical intervention.
"The defendant had to be operated on by a surgeon. His bowel was opened surgically and the various items were removed."
The court heard Amis had 109 tablets, including painkillers, anti-depressants and steriods, as well as medication in powder form and cannabis, plus the two phones, tobacco, metal and paper, removed during the operation.
Amis, who has a long criminal record, had inserted the illegal items into his body before he handed himself into a police station, where he was wanted for theft.
He appeared at magistrates' court the following morning and was given an eight-week prison sentence, which resulted in him being transferred to HMP Durham, where he collapsed the same day.
He later confessed he had smuggled in the illegal haul to pay off a £2,000 drug debt.
Amis, of Bentick Terrace, Newcastle, pleaded guilty to five charges of conveying banned articles into prison.
He also admitted attempting to rob a "little old lady" who he pulled to the ground while trying to snatch her handbag
Judge Amanda Rippon sentenced him to a total of four years behind bars.
She told him: "At HMP Durham you collapsed and were taken to hospital. It was discovered you had those packages inside you and they had to be removed, surgically, from your colon.
"Mobile phones and drugs are a significant problem in prisons. Custody is the only sentence that will be imposed when people take such a quantity into prison.
"You planned this, without question. The surgery and consequent problems you had you can only blame on your own actions."
Alec Burns, defending, said Amis is now drug-free for the first time in many years and regrets his past behaviour, particularly the targeting of an elderly woman.
Mr Burns said Amis had hoped to keep as much of his contraband for himself as he could.
"He knew one telephone might assist him by way of his problems in there.
"He didn't really know what was going to happen. He was doomed to fail. He had taken inside so much material, it was always going to cause a problem.
"He did suffer for his smuggling in that, when he collapsed, he required surgery."
Mr Burns said Amis has ongoing problems as a result of the surgery, and collapsed again in jail recently.
He added: "He has suffered the effects of his own stupidity."