"The fact that Fresco was dishonest in the sunroof incident does not render his evidence as a whole unreliable," Judge Thokozile Masipa ruled.
She had moments before found Pistorius guilty of culpable homicide for the killing of his girlfriend Reeva Steenkamp on February 14 last year. Masipa had found Pistorius not guilty of murder.
Fresco's testimony did not relate to the murder charge.
The paralympian also faced three charges of contravening the Firearms Control Act -- one of illegal possession of ammunition and two of discharging a firearm in public.
According to count three on the charge sheet he allegedly fired a shot from Fresco's Glock pistol under a table at Tasha's restaurant in Johannesburg in January 2013. Masipa found him guilty on count three.
On count two, of which he was acquitted, on September 30, 2012 he allegedly shot through the open sunroof of a car with his 9mm pistol while driving with Fresco and ex-girlfriend Samantha Taylor in Modderfontein.
Fresco faced charges relating to the sunroof and Tasha's shootings. He testified for the State in exchange for indemnity from prosecution, if the court found him to have been an honest witness.
Masipa said she was willing to excuse Fresco's lie that Pistorius shot through the sunroof "out of nowhere". Taylor, who was with the pair at the time, however testified for the State that the two had discussed shooting at a robot before the shot was fired.
Masipa said boxer Kevin Lerena corroborated Fresco's version of the Tasha's shooting.
"Mr Darren Fresco answered frankly and honestly all questions put to him. He is discharged from prosecution," Masipa said.
Prosecutor Gerrie Nel got up and said: "As the court pleases." Pistorius's lawyer Barry Roux did the same.
Masipa adjourned court for five minutes after whispering to one of her assessors.
Fresco began crying and wiping his eyes with a pink tissue.