Police were tracking the two men arrested near Aldi in Lincoln Green as part of an investigation into a spate of shootings in recent weeks.
The armed sting on Thursday night was part of an investigation into the shooting of a man in Meanwood on November 20 and two more incidents where guns were fired in Chapeltown and Woodhouse this week.
Officers found a loaded gun, ammunition and a knife at the scene near the Aldi store and Mushroom Street.
The three incidents being linked to the arrests are:-
Meanwood - November 20
A 21-year-old man was shot in the leg near a house on Stainbeck Road just before 5pm. His injuries were not life-threatening.
However, a BMW believed to be used by the suspects was then involved in a crash with an innocent member of the public's car.
It collided with a Nissan Micra nearby and the 33-year-old woman who was driving had to be taken to hospital.
The two men in the BMW fled the scene. Police later stated they believed the car was linked to the shooting.
Chapeltown - December 1
A shop was robbed in Chapeltown last Saturday and a gun was fired. Nobody was hurt and police have not confirmed the exact location of the incident.
Woodhouse - December 5
An aggravated burglary of a house in which a gun was fired. Nobody was hurt.
Who are the men arrested?
They're aged 28 and 24. They are currently in custody on suspicion of firearms offences, and have not yet been charged. The 28-year-old was Tasered during the sting near Aldi and treated in hospital for minor injuries. Distraction devices such as stun grenades were also used by police.
Senior Investigating Officer, Detective Chief Inspector Jaz Khan, who heads the Firearms Prevent Team, said:
“The criminal use of firearms on the streets is something that we will always treat very seriously and these arrests are a significant development in our ongoing investigations into recent firearms offences. “We have a number of scenes currently in place to undergo specialist searches and we will be interviewing the men arrested as our enquiries continue.
“Highly-trained specialist firearms officers have used necessary and appropriate tactics to safely detain these men without incident, resulting in the recovery of a loaded firearm and ammunition.
“We recognise that these tactics may have caused some initial concern in the community but we hope people will now understand and support our actions as part of our investigation into very serious offences.
“Specialist detectives from the Firearms Prevent Team and Homicide and Major Enquiry Team will be continuing to conduct thorough and comprehensive enquiries into these incidents, and we are liaising closely with our neighbourhood policing colleagues to assist them in reassuring the community.”