The Mexican

The story follows Jerry Welbach (Brad Pitt) as he travels through Mexico to find a valuable antique gun, The Mexican, and smuggle it into the United States. Five years earlier, Welbach had caused a traffic accident in which he hit the car of local mobster Arnold Margolese (Gene Hackman), who was jailed for five years after the police searched his car following the crash, finding someone tied up in his trunk. In compensation for the jail time, Welbach has been sent on various errands by Margolese's prickly second-in-command, Bernie Nayman (Bob Balaban). Retrieving the gun will be his final errand. Welbach has a girlfriend, Samantha (Julia Roberts), with whom he argues constantly and who leaves Jerry prior to the trip over his lack of commitment to their relationship.
Jerry arrives in Mexico and makes his way to pick up Beck (David Krumholtz), the Margolese employee now in possession of the gun. There, a drunken Beck tells Jerry about the gun's history as a suicide weapon used as part of a jilted love-triangle between a woman, a nobleman, and the son of the gunsmith who forged the weapon, as well as its curse to misfire. Jerry helps Beck to his car, only for the man to be killed by celebratory gunfire from a nearby festival.
Panicked but determined, Jerry buries the body and then calls Bernie to report on the situation, only for his vehicle to be stolen while he makes the call, the gun still inside. Jerry briefly has an uncooperative donkey as transportation to follow the thief, then buys an old, damaged truck.
Meanwhile, Samantha gets kidnapped by a hit man named Leroy (James Gandolfini), who tells her that Jerry hired him to make sure she is safe from anybody that wants her dead. It is then revealed that Leroy is gay, which doesn't bother Samantha. They pick up a postal worker named Frank (Michael Cerveris), who then has a relationship with Leroy.
Another hitman follows them to Las Vegas and kills Frank to make it look like a suicide. Leroy kills him in an act of vengeance, and flees with Samantha. Jerry finds out that Ted (J. K. Simmons), his friend and colleague, wanted to kill him and take the pistol to Margolese, but hesitated and ends up getting handcuffed to a pawnshop owner, after he received the gun from a policeman when Jerry was being interrogated for the bloodstain on the front passenger seat of his car. Jerry then finds out he accidentally grabbed Ted's Passport and tries to retrieve his own, but Ted has already fled. Jerry decides to pick up Samantha and Leroy at the airport, where Leroy recognizes him, but Jerry doesn't recognize Leroy. Without a passport, Jerry is stuck in Mexico until further notice by the American Consulate.
After their car has a blowout, Jerry kills Leroy and finds out that he is one of Nayman's men named Winston Baldry, and that the real Leroy was the man Winston killed. Samantha begins to realize that Leroy was not who he appeared to be when they first met. Jerry realizes that Nayman's plan was to make it look like Jerry double crossed Margolese. Shocked by this, Samantha decides to go home, but also decides to stay with Jerry to see the situation to the end. Jerry gets assaulted and taken to Margolese who was released from prison a few days earlier. He tells Jerry that he didn't double cross him as it was Bernie who wanted to sell the pistol to the highest bidder.
A gunsmith, who is the great-grandson of the gunsmith from the story, wanted to bring the pistol back to where it belongs. He thanks Jerry for risking his life for the pistol he was going to give to his greedy boss. Samantha gets kidnapped by Bernie in order to get the pistol from Margolese. After opening the trunk to his car, she pulls the gun on Bernie, blaming him for ruining her life, where it ends in a Mexican standoff. Samantha gets the upper hand and kills Bernie with the pistol he desperately needed. Jerry and Samantha rekindle their romance and get married in Mexico, while Margolese finally gets his prize, as well as the gunsmith. The film ends with Jerry and Samantha arguing over the story of The Mexican on their way to Vegas.

Question: Who kills Bernie?
Answer: Samantha