The background to the shooting may have been because Mr Inamder beat up Johnson’s brother.

In January this year Johnson was recorded during a conversation in which he talked about almost shooting his own finger off with the Baretta.

He was heard to say: “I pressed it and boom - and the bullet shot through the bed.”

Johnson was also heard making reference to a shooting in Woodhouse Park in August 2012, where a pistol was discharged at Inamder on a separate occasion.

Ziemiecki and Johnson also admitted drug offences over their involvement with large scale drug supply in West Yorkshire and the north east.

Ziemiecki was arrested by police in Middlesbrough on September 25 last year after he handed over a rucksack containing three kilogrammes of heroin in a pub car park to other dealers.

In a separate operation by West Yorkshire officers in Leeds, Ziemiecki was arrested at a house on Parkstone Grove, Ireland Wood, in February this year.

Officers had observed him going into the property with two bags which were found to contain 50kgs of caffeine and paracetamol.

The court heard the substances are commonly used as a bulking agent for heroin and could have been mixed with enough of the class A drug to be worth around £150,000.

Johnson’s drug offences were uncovered after the listening device was placed in his Renault Clio in November 2014.

A total of 63 conversation were picked up which related to drug dealing.

References were made to a range of drugs including cocaine, cannabis, ecstasy and mkat as well as cannabis production.

Ziemiecki, 32, of Christopher Road, Meanwood, pleaded guilty to possession of a firearm with intent to endanger life and two offences of conspiracy to supply a class A drug. He was jailed for 14 years

Johnson, 29, of Ganton Close, Chapeltown, pleaded guilty to possession of a firearm with intent to endanger life, possession of a prohibited weapon and conspiracy to supply a class A drug. He was jailed for 13 years.

The court heard both men have long criminal records.

Lawyers for both men said neither of them wanted to kill Inamder in the shooting but only intended to scare him. They said other criminals were higher up the drug supply chain then them.

Mr Justice Males told Ziemiecki: “You are a trusted member of a criminal gang dealing in drugs with access to firearms.”

The judge told Johnson: “You are a person who was willing to supply drugs to others and to keep a loaded firearm ready for use at your house.”

After the case, the judge praised the efforts of the detectives for their hard work in bringing to two men to justice.

Detective Chief Inspector Warren Stevenson, of West Yorkshire Police Protective Services (Crime), said: “These men were heavily involved in large-scale drug dealing and were prepared to use firearms to settle their scores. The significant sentences they have received reflect how seriously offences of this nature are treated.

“The criminal use of firearms always presents a threat to the wider community and we will use every available tactic to target those who are involved and remove their guns from the streets. The weapons recovered in this case would clearly have been recirculated for use in other crimes.

“These men were brought to justice as a result of a lengthy and painstaking investigation by specialist detectives which produced the evidence that has seen them sent to jail. We hope it will provide some reassurance to our communities to know they are much safer without these men among them.”