An episode of "Curb Your Enthusiasm" helped free Juan Catalan.
Who would think that Larry David would save an innocent man from death row?
Read: Pretty, Pretty, Pretty Related: Larry David Learns He's Bernie Sanders' Third Cousin
The remarkable story began as David and his crew were shooting a scene at Dodger Stadium in Los Angeles for an episode of Curb Your Enthusiasm in 2003.
In the episode, the Seinfeld co-creator picks up a prostitute to beat LA traffic in the carpool lane to make it to the stadium on time.
Filming took place at the stadium during an actual game between the Dodgers and the Atlanta Braves.
"We walk into the baseball game and it was like a real game," Actress Kym Whitley, who played the prostitute, recalled to Inside Edition. "I was like, 'how did you get all of these people here?'"
Among the 56,000 fans filling the stadium was Juan Catalan, who was arrested four months later in the gang-related shooting of a 16-year-old girl.
Catalan claimed he didn't do it, saying he was at the Dodgers game at the time of the killing.
David later gave Catalan's lawyer the show's outtakes, which contained a shot that showed Catalan sitting with his daughter. He was cleared of all charges.
The remarkable story is now the subject of a new Netflix documentary, Long Shot, which premiered Friday.
Even the ever-cynical David marvels at how he gave an innocent man back his freedom, albeit by accident.
"This is a very special episode to Larry — not because it was funny — because it saved a man's life," Whitley told Inside Edition.
The city of Los Angeles paid Juan Catalan $320,000 for wrongfully charging him with murder.
Watch: Dozens of Fans Dressed Up Like 'Magnum P.I.' at Ballgame Get Booted for Being Too Rowdy