The movie opens at night as a police car screeches to a halt in the middle of a deserted street. It is not the first unit to arrive - the entire street is clogged with police units, and officers are training their weapons at an elementary school where an axe-wielding serial killer named Ripper is holding several children hostage. The senior officer, Capt. Dekker (Frank McRae) laments that this is the worst way to spend Christmas. He summons an officer and orders the sidewalks secured. Just as soon as he's given this order, gunfire breaks out as the unseen Ripper opens up on the police cars with an assault rifle. A few officers are downed and multiple cops are shot. Once the gunfire stops, Ripper tosses the rifle over the edge of the roof, followed seconds later by the rifle's original user. Dekker curses Ripper for killing one of his men.
A few moments later, a new face arrives, in the form of Jack Slater (Arnold Schwarzenegger). He walks through the police barricade, refusing to listen to Dekker's threats to confiscate his badge. The mayor and lieutenant governor are present and attempt to stop Slater, but he punches the lieutenant governor in the nose. He then delivers a groin attack to the officer guarding the entrance, then draws his pistol and makes his way to the roof.
On the roof, Slater confronts Ripper (Tom Noonan), who is holding Slater's son Andy hostage with a chopping axe. Slater steps closer as Ripper tells him about how he has felt a sense of revenge ever since Slater sent him to prison ten years ago. Ripper tells Slater to put his pistol down. Slater complies, but Ripper isn't satisfied to find that his foe only has one gun with him. Slater reluctantly then removes his pocket knife and the other pistols he is carrying on his person. Asked by Ripper if that's all he's carrying, Slater says that yes, he is now unarmed, unless what he is currently carrying counts as a weapon: a "grenade" with a blade that pops out of it, that he tosses to Andy.
Ripper laughs, astonished to find that Slater is willing to sacrifice his own son's life to get to him. He orders Andy to pick up the grenade and hand it to him. He tells Slater that while the grenade won't hurt Andy, his axe will. Slater and Andy exchange a look. A knife blade pops out of the grenade and Andy stabs Ripper in the leg. Slater dives to the ground and grabs one of his pistols as Ripper hurls the axe at him. He raises his gun and fires twice, both rounds hitting Ripper. As Ripper falls to his death, he takes Andy with him.
Suddenly, the image goes out of focus. It turns out we're actually in a New York City movie theater after hours, where a young action-movie obsessed boy named Danny Madigan (Austin O'Brien) is watching the end of Jack Slater III, the third movie in the popular franchise of Jack Slater movies starring Arnold Schwarzenegger in the titular role. Annoyed that the movie is out of focus, Danny makes his way up to the projector room to wake up the projectionist, an elderly man named Nick (Robert Prosky). Nick fixes the focus, but the credits are already rolling. He apologizes for not seeing that beforehand, but Danny forgives him, as he 's seen this movie six times already. Nick tells Danny that the next movie, Jack Slater IV is scheduled to come out this Friday. It turns out Danny has seen the trailers for that movie and knows that it will involve Slater avenging his second cousin's death. Nick claims he's checking the print he's received for the new movie tonight, and offers to arrange to give Danny admittance to a private preview showing.
Danny then goes to school. As he leaves the theater, he sees a cardboard cutout of Slater with a shotgun in one hand and a stick of dynamite in the other, alongside new cast member Meredith Caprice (Bridgette Wilson), who gets an "And Introducing" credit, advertising Jack Slater IV. In class, his teacher (Joan Plowright) is teaching the class about Shakespeare's Hamlet, who is one of history's first action heroes. She proceeds to show the class a scene from the 1990 Laurence Olivier film adaptation of the play. The scene in question is the one where Hamlet contemplates killing his uncle Claudius but decides against it because Claudius is praying, and monologues about it.
Danny is annoyed that Hamlet stops short of killing Claudius when he could have done it right there and ended the story. He promptly imagines his own version of the scene. In his version, Schwarzenegger plays a cigar-smoking Hamlet, who grabs Claudius and accuses him of murdering his father, before hurling him out a stained-glass window. An announcer blares "Something is rotten in the state of Denmark, and Hamlet is taking out the trash!" SchwarzenHamlet then proceeds to surprise and attack numerous guards, defeating them with thrown skulls and swords. He continues to go on his murderous rampage until a figure appears from behind a curtain saying "Stay thy hand, fair prince." SchwarzenHamlet quips, "Who says I'm fair?" then proceeds to produce a submachine gun and slaughters an entire castle of guards as the announcer assures that no one will tell this sweet prince goodnight! SchwarzenHamlet quips, "To be, or not to be. Not to be." then blows up the castle.
As the castle is destroyed, the scene transitions to Danny watching the Looney Tunes at home while his mother Irene (Mercedes Ruehl) calls the school attendance office to tell them that Danny is "sick". She is somewhat annoyed to find that Danny has been to the movie theater again to see Nick. She then hurriedly realizes she is late for work and rushes out the door.
Shortly after Danny's mother leaves, an intruder breaks in and takes Danny hostage, handcuffing him by one wrist. He looks around for something to steal, but is outraged when he finds nothing worth taking, and departs, dropping the handcuff key in the toilet. Danny goes to the police station to deliver a report. Despite the officer on duty telling him to go home as his mother has instructed him to, Danny instead goes to the movie theater to meet Nick. After letting Danny in through a service door, Nick talks about how he always wanted to be a magician. Before letting Danny see the movie, Nick hands him a special ticket, which he says he received from Harry Houdini. It supposedly is a passport to another world. It has a mind of its own and does what it wants to do. Nick tears the ticket in half and gives part of it to Danny.
Nick starts the movie. The opening credits burn through the Columbia Pictures logo, busting through several walls until it finds the title Jack Slater IV. The scene then settles on a mansion overlooking a cliff near Malibu. Mob boss Tony Vivaldi (Anthony Quinn) is on the patio outside, interrogating Slater's favorite second cousin Frank (Art Carney), who is tied up and has been beaten severely. Vivaldi wants to know what Frank has told Slater about his operation. He tells Frank to tell Slater that his organization is joining forces with the Torelli family, another organized crime syndicate, to establish total control of illegal drug trade in Southern California. Frank claims he mostly talks to Slater about guns and muzzle velocities.
Not satisfied, Vivaldi snaps his fingers and a bullet hits the orange target to Frank's right. The source of the bullet is Vivaldi's British hitman Benedict (Charles Dance), sitting in a chair overlooking the ocean and reading a newspaper. Benedict is unusual in that his left eye is a false acrylic one that he can pop out and replace with a different one depending on what each situation requires. Vivaldi warns Frank that Benedict is a professional killer, who sometimes even likes to bake while shooting people. But it also turns out that Benedict is annoyed that Vivaldi keeps screwing up metaphors all the time, like saying "easy as cake" when the saying is "easy as pie". Vivaldi asks Frank if he wants Benedict to operate on him. Vivaldi tells Benedict to take Frank and dump him back at his own house. He laughs in amazement at the fact that Frank is buying his nonsense about joining forces with another syndicate, but after the funeral that is going to happen in a few days time, everyone will know Vivaldi is Number One.
Sometime later, four police officers are outside a two story house near downtown Los Angeles. They are about to execute a drug bust. Before they can kick the door down, Slater pulls up in his convertible with groceries and asks what they are doing, as they're on the porch of his cousin's house. Slater sets his groceries down, then knocks incessantly on the door. Finding it unlocked, he opens the door and finds Frank sitting in a chair in the foyer, on the verge of death. Frank tells Slater that Vivaldi is joining forces with the Torelli mob, and then dies.
As Slater apologizes to Frank, he sees a small card with his name on it attached to Frank's shirt. He shuffles through the cards, which count down "5, 4, 3, 2, 1." When Slater reaches "2," he realizes it's a trap and hurriedly bolts out of the house just as a hidden bomb detonates. The house is incinerated in a giant fireball that throws Slater and the two cops on the porch into the air. A police car is also flipped over. The two cops are killed, while Slater is miraculously uninjured.
Slater gets up, just as a red 1950s pickup truck comes speeding around the corner at full speed, driven by a group of henchmen toting automatic weapons. Slater gets in his car and floors the gas pedal as the henchmen open fire on him. He speeds around a corner, around the flipped over police car. As they speed down the street, one of the henchmen stops shooting, and grabs a stick of Acme dynamite from the bed of the truck. He hurls it at Slater's car, but it bounces off the trunk, lands in the street, and explodes harmlessly. Going around a left turn, the henchman lobs another bundle at Slater, but Slater produces his Desert Eagle pistol and shoots it multiple times in midair.
It is at this point that Danny's magic ticket starts glowing. He doesn't realize it until the bundle of dynamite Slater shot suddenly bursts out of the screen and into the theater. He gets up and starts to run as the bundle begins rolling down the aisle with a lit fuse. He snuffs the fuse with his popcorn bucket, then runs up the aisle, only to be engulfed in a flash of blinding white light.
When Danny's vision is restored, he's in the backseat of an unfamiliar car looking up at palm trees under a sunny sky. As Danny is rising, trying to get a view of his surroundings, Slater suddenly fires his pistol at the pursuing truck. It turns out Danny has been transported into the car chase scene he was watching literally seconds earlier. Slater turns, startled to find a passenger in his backseat. Danny has no idea how he ended up there. Slater tells him to keep his head down as he speeds through a left turn, taking more fire from the gunmen in the truck. One of the henchmen lobs another stick of dynamite, but it misses and instead blows up a car parked on the curb. Driving down the next street, Slater swerves from side to side in an effort to throw the henchmen's aim off. Without his car losing control, Slater takes both hands off the wheel, turns backwards, and fires his pistol several times at the truck. One henchman is thrown off the pickup, and through the windshield of a parked ice cream truck, which promptly explodes, and causes a different henchman to get an ice cream cone through his neck. Slater eventually loses the pickup truck when it is cut off by a backing up tanker truck blocking its way.
As Slater drives with Danny as his extra passenger across the LA River Basin, a minivan screeches to a halt in the middle of the road ahead of him. Henchmen armed with a chain gun open the passenger door and begin firing on him. Slater turns left and plows through the bridge railing. His car falls into the river basin and keeps on going. The minivan drives down the side of the embankment and gives pursuit. When the remaining men from the pickup truck fire on Slater at the next bridge, Slater makes a hard right turn up the slope of the banking. The car flies into the air and lands on the roof of a Coca-Cola semi truck, then drives off of it.
After losing the remaining bad guys, Danny tries to convince Slater that they are in a film, but Jack sees nothing unusual about his world, which includes a cartoon cat detective named Whiskers (voice of Danny DeVito), a black-and-white image of Humphrey Bogart, female officers dressed in outlandish battle armor, even cameos by the T-1000 (Robert Patrick from his role in Terminator 2: Judgment Day) and Catherine Tramell (Sharon Stone from Basic Instinct).
As Jack and Danny drive along the coast looking for the "bad guys", Danny recognizes, from the opening sequence, the mansion belonging to crime boss Tony Vivaldi (Anthony Quinn). Despite Jack's skepticism, they go in and meet Vivaldi's British henchman Mr. Benedict (Charles Dance), known for his ever-changing glass eyes. After overhearing Danny discussing his role in the Slater film, Benedict follows Jack and Danny as they visit Slater's daughter, Whitney (Bridgette Wilson; though the Slater movie credits her as "Meredith Caprice"), raids the house with some thugs, takes the magic ticket from Danny, and escapes after a gun battle with Jack and Whitney. While inspecting the ticket at the mansion, he discovers a portal to the real world.
Eventually, Jack and Danny figure out that Vivaldi plans to kill his rivals at a rooftop funeral by planting nerve gas in a dead body. After a brief scene in which Whiskers saves the two from betrayal by Slater's friend John Practice (F. Murray Abraham), Jack tells Danny to commandeer a construction crane, takes the body and escapes from the funeral, and disposes of the body into a tar pit with Danny's help at the crane. Whitney arrives in her truck immediately afterward, and Jack and Danny use the truck to crash into the villains' mansion shortly after Benedict irritably betrays and shoots the inept Vivaldi. In the ensuing struggle, Benedict and his butler fall through a portal into the real world, and Jack and Danny follow them. In the real New York City, Jack is disappointed to learn that he is a fictional character and resentful at having been given such a hard life by his films' creators, particularly Schwarzenegger himself. While talking with Irene, he learns to be sensitive and loses interest in violent action.
Meanwhile, Benedict learns that in this world he can get away with murder and hatches a plan to wipe out Jack by killing Schwarzenegger. Jack correctly guesses Benedict's plan after Benedict uses the ticket to escape a car chase, leaving behind a newspaper with hand-drawn marks on some film advertisements.
At the premiere of Jack Slater IV, after a brief encounter with Schwarzenegger (himself), Slater confronts the Ripper (Noonan), the ax-wielding villain who killed Jack's young son in the climax of Jack Slater III and whom Benedict has brought to the real world. In a rooftop scene similar to the finale of Slater III, the Ripper throws Danny from the roof before being electrocuted by Jack. Slater finds Danny clinging to the side of the building and pulls him to safety, but Benedict confronts Jack and shoots him in the chest while ranting about his plans to form an army of film villains (such as Dracula, Freddy Krueger, Adolf Hitler, Hannibal Lecter and King Kong) and take over the world. Danny knocks Benedict to the floor, enabling Jack to get Benedict's gun and shoot Benedict directly in his explosive glass eye, blowing his head to smithereens; but the ticket flutters off the roof and lands in front of a movie theater showing The Seventh Seal. Death (Ian McKellen) emerges from the resulting portal and follows Jack and Danny to the Pandora, where Danny hopes to save Slater by transporting him back into the film. Death notices that Slater is not on his list (but Danny is due decades later) and advises Danny to find the other half of the magic ticket, which he does. Jack and Danny are transported into Slater IV, where the wounds are minor. On Jack's insistence, Danny returns to the real world. The film ends as Jack explains his new insights to Dekker, then drives into the sunset.