In 1916, the notorious bandit El Guapo (that’s me – it means The Handsome One) and his gang of thugs are collecting protection money from the small Mexican village of Santo Poco. Carmen, daughter of the village leader, searches for someone who can come to the rescue of her townspeople. While visiting a small village church, she watches a silent film featuring "The Three Amigos" and, believing them to be real heroes, sends a telegram to Hollywood asking them to come and stop El Guapo. However, the telegraph operator edits her message down since she has very little money to pay for it.
Meanwhile, Lucky Day, Dusty Bottoms, and Ned Nederlander are Hollywood silent film actors who portray the heroic Amigos on screen. When they demand a salary increase, studio boss Harry Flugleman fires them and evicts them from their studio-owned housing. Shortly afterward, they receive Carmen's telegram, but misinterpret it as an invitation to make a show appearance with El Guapo.
After breaking into the studio to retrieve their costumes, the Amigos head for Mexico. Stopping at a cantina near Santo Poco, they are mistaken for associates of a fast-shooting German pilot, who is also looking for El Guapo and who arrived just before they did. The Amigos perform a show at the Cantina, singing "My Little Buttercup", and leave the locals bemused. The German's real associates then arrive at the cantina, proving themselves adept with their pistols. A relieved Carmen picks up the Amigos and takes them to the village, where they are put up in the best house in town and treated very well.
The next morning, when three of El Guapo's men come to raid the village, the Amigos do a Hollywood-style stunt show that leaves the men very confused. The bandits ride off, making everyone think that the Amigos have defeated the enemy. In reality, the men inform El Guapo of what has happened, and he decides to return in full force the next day and kill the Amigos.
The village throws a boisterous celebration for the Amigos and their (supposed) victory. The next morning, El Guapo and his gang come to Santo Poco and call out the Amigos, who confess that they have only been acting and are too scared to confront him after Lucky gets shot in the arm. El Guapo allows his men to loot the village and kidnaps Carmen, and the Amigos leave Santo Poco in disgrace.
With nothing waiting for them back home, Ned persuades Lucky and Dusty to become real-life heroes and go after El Guapo. Their first attempt to find his hideout fails when Dusty kills the Invisible Swordsman, but they spot a cargo plane and follow it to El Guapo; the plane is flown by the German, who has brought a shipment of rifles for the gang with his associates' help. Preparations are underway for El Guapo's 40th birthday party, and he plans to make Carmen his bride. The Amigos try to sneak into the hideout, with mixed results: Lucky is captured and chained up in a dungeon, Dusty crashes through a window and into Carmen's room, and Ned ends up stuck in the piñata.
As Lucky frees himself and Dusty sneaks out only to be caught, Ned falls loose and is also captured. The German, having idolized Ned's quick-draw and gunspinning pistol skills since childhood, challenges him to a shootout. Ned wins, killing the German, and Lucky holds El Guapo at gunpoint long enough for Carmen and the Amigos to escape – first on horseback, then in the German's plane.
Returning to Santo Poco with El Guapo's entire army in pursuit, the Amigos rally the villagers to stand up for themselves and plan a defense. The bandits arrive in the seemingly empty village, only to find themselves suddenly being shot at by Amigos from all sides and falling into hidden water-filled trenches dug by the villagers. Eventually all of El Guapo's men either desert him or die in the gunfire, and he takes a fatal wound as well. As he lies dying, the villagers – all armed and wearing replicas of the Amigos' costumes – step out to confront him. El Guapo congratulates them on this plan, then shoots Lucky in the foot and dies.
The villagers offer to give the Amigos all the money they have, but the Amigos refuse it, saying (as in their movies) that seeing justice done is enough of a reward for them. They then ride off into the sunset.