Four men who took part in a gangland shooting have been jailed for a total of more than 68 years.
Ringleader Tony Trott was locked up for 26 years, and self-styled underworld enforcer James Lee Ratcliff, who pulled the trigger, was given 24 years.
Lee Barnett, who went with Trott and Ratcliff to the scene of the shooting in Hylton Castle, Sunderland, was given 16 years.
Philip Steabler, described as a petty criminal who helped with the logistics of the shooting, was jailed for 35 months.
Judge Deborah Sherwin, who sentenced the men at Teesside Crown Court, said deterrent sentences were called for for those directly involved in the shooting.
"Gun crime is still surprisingly rare in the North East," said the judge. "It is even rarer when a firearm is used to threaten, that the gun is discharged, as in this case.
"This was undoubtedly a revenge attack by one group of organised criminals against another.
"In that respect, the risk to the wider public is not great, but it must still have been terrifying for the residents of Hylton Castle to think this could happen on their doorstep."
Prosecutor Peter Makepeace QC told the court the shooting happened in the wake of a burglary at a house in Hylton Road in Sunderland in September 2016.
"The house was being used by Tony Trott for the safe storage of drugs," added Mr Makepeace.
"Despite the serious nature of the burglary, the occupant did not call the police, but instead contacted Tony Trott, Barnett, and Steabler.
"Trott, in turn, recruited Ratcliff who was to do the actual shooting.
"The burglary that had taken place was undoubtedly a taxing by one drugs gang on another, and the shooting was a retaliatory attack."
Six 6.35mm Browning bullets were fired through the living room window of the house in Craigshaw Square, the court heard.
"Three adult males were in that room," said Mr Makepeace. "It is extraordinary good fortune that none were hurt.
"CCTV captured a Pajero car arriving at the scene, its lights extinguished just prior to arrival.
"Ratcliff and another male exited the vehicle, and walked into Craigshaw Square.
"The driver remained in the car, repositioning it as Ratcliff walked further into the square, discharged the gun, and fled back towards the Pajero.
"They were closely pursued by an occupant of the house, but were able to get back into the Pajero and make a fast getaway."
A second vehicle, a Peugeot, was used by the gang as a back-up and to help them disperse afterwards.
Mr Makepeace said the use of the Peugeot indicated the shooting and its aftermath was carefully planned, even though it was arranged spontaneously, happening just a few hours after the burglary.
The Pajero was later found burned out, and the Peugeot, which belonged to Steabler, was later taken by him to be crushed at a scrapyard in Pallion.
Trott, Ratcliff, and Steabler were each involved in a conspiracy to supply cocaine in Sunderland and Hartlepool.
On seven occasions in 2016 police observed drugs and cash handovers between the men and their contacts from elsewhere in the country, including Merseyside and Yorkshire.
The largest cash seizure was more than £29,000 found in a car which was stopped on the A19.
"The transaction had been arranged by Tony Trott," said Mr Makepeace.
"His father was a passenger, and the driver was his father's partner.
"The cash was in a child's rucksack, and the package bore the fingerprints of Tony Trott's partner.
"An examination of the car's sat nav showed it was on its way to Liverpool."
Trott, 30, of South Terrace, Sunderland, was sentenced for possessing a firearm with intent to endanger life, and conspiracy to supply cocaine.
Barnett, 42, of Throston Grange, Hartlepool, was sentenced for conspiracy to possess a firearm with intent to endanger life.
Ratcliff, 35, of no fixed abode, was sentenced for conspiracy to possess a firearm with intent to endanger life, conspiracy to supply cocaine, and assault occasioning actual bodily harm.
Steabler, 41, of Thorndale Road, Sunderland, was sentenced for assisting an offender, and for being concerned in the supply of cocaine.
Due to the way Judge Sherwin passed sentence, Trott must serve a minimum of 20 years before he can be considered for parole, and Ratcliff must serve a minimum of 18 years.
Both men will be the subject of an extended licence period after their release.
A hearing on a date to be fixed will determine if Trott, Ratcliff, and Steabler have any assets which can be seized as the proceeds of crime.
Tony Trott, 30. The ringleader who arranged the shooting to prove to a rival criminal gang he was not a man to be messed with.
Trott has previous convictions for 53 offences, mostly involving drugs and violence.
It was said in mitigation both his parents are seriously ill, and being in prison he misses his two children.
James Lee Ratcliff, 35, The man who fired the gun through the window of the house in Hylton Castle.
Told police he was an 'enforcer' and that dealing drugs was easy money, easier than 'knocking people all over'.
Ratcliff has 54 previous convictions for offences involving violence, theft, and motoring.
It was said in mitigation he had a difficult early life in Pennywell.
Since being remanded in custody he has been a model prisoner.
Lee Barnett, 42. Went with the others to the scene of the shooting.
He has 38 previous convictions, mostly for offences involving dishonesty.
It was said in mitigation he was addicted to cocaine, but has since come off the drug.
Another model remand prisoner.
Philip Steabler, 41. Used his Peugeot car as a back-up vehicle on the night of the shooting, and arranged for it to be crushed afterwards.
The only one of the four to admit all of his offending.
He has previous convictions for petty dishonesty and motoring offences, and one previous conviction for possession of cocaine and amphetamine.
It was said in mitigation he is in work and his offending has had a big impact on his wife and three children.