The movie opens with a corrupt and sniveling bank manager Mathur (Prem Chopra) and crime baron J.K. Verma (Amrish Puri). Mathur is in a financial dilemma as he has illegally loaned J.K. 2.5 million rupees, and J.K. orchestrates a bank robbery to bail him out. Inspector Anand Shrivastav (Kader Khan) gets wind of this plot. He arrests a key henchman of J.K., and is about to crack the case when J.K. enlists an exotic dancer, Julie (Aruna Irani), to use the robbery as a backdrop and frame the honest inspector for corruption. Inspector Shrivastav is arrested and is imprisoned for three months. Inspector Shrivastav, the honest and innocent inspector, is so depressed about the false charges that he hangs himself at home after being released on bail. This creates a lasting and powerful impression on his young eight-year-old son, Vijaykumar (Amitabh Bachchan), simply known as 'Vijay', who firmly believes in his father's hard work, innocence, and dedication, for years. Every day, he thinks about his father's uncalled for decision. Vijay retains the noose his father used to hang himself. He would someday restore his father's honour. Vijay and his mother leave their house and live in the house of another police inspector named Aslam Khan, who would take care of them as Vijay grows up.
As Vijay grows, his determination to avenge his father grows too. 20 years later, a young Vijay (Amitabh Bachchan) in the inspector uniform, grows up in the care of Inspector Aslam Khan (Pran), Inspector Shrivastav's friend and partner, who has allowed Vijay and his mother to live with him, and Vijay becomes a cop himself. Vijay is friends with Shaheena, the daughter of Aslam Khan. Aslam Khan is an honest cop much like Vijay's father. Vijay is an obsequious and cowardly inspector, prone to bribery and generally scared of powerful criminals. It doesn't take JK long to find Vijay, get him on payroll, and run his underworld crime empire (drugs, guns, racketeering) past the cops.
A new apparition bursts upon this scene who calls himself "Shahenshah", a costumed crime fighter (see movie poster). He has a left iron hand which is used to attack enemies and smash objects, and Shahenshah's other weapon is a noose. Oddly enough, it is the same noose Vijay's father used to hang himself with. This is because it is revealed a bit later that Shahenshah is actually Vijay. When wearing Shahenshah's attire, Vijay describes himself as "one who doesn't hold a cop's job but does the same work; one who apprehends criminals himself, conducts the trials himself, and, pronounces and executes the sentences himself". A bit later, the mysterious Shahenshah reveals to the public that he is none other than Vijay. Frustrated and helpless at the corruption in the police force, Vijay has employed this new tack to get to the criminals. Vijay/Shahenshah's outward mission is to take out crime, but his real goal is to get to the guys who framed his father.
Shahenshah quietly breaks up several of J.K.'s gambling dens and illicit liquor distilleries. He also halts the demolition of a slum. This catches the eye of small-time trickster Shalu (Meenakshi Seshadri) who lives there with her aging and ailing mother Julie. J.K. had ordered her assassination after she helped frame Vijay's father; she has been on the run from him ever since; this becomes Shalu's motivation for seeking out and eliminating J.K. Shalu decides to infiltrate J.K.'s coterie by becoming an exotic dancer. One night, she attempts to kill J.K. by shooting him but is shocked when J.K. reveals he had been wearing a bullet-proof vest the whole time. Vijay lies to J.K. that Shahenshah's weakness is not letting Shalu die. He also lies that if J.K. returns Shalu to Shahenshah, Shahenshah will return J. K.'s goods worth millions. But J.K. is ultimately fooled. Shahenshah later detonates a bomb planted in J.K.'s truck.
Julie later reveals that she was on Inspector Shrivastav's side all along and was pretending to be on J.K.'s side the whole time; her supposedly helping J.K. frame Inspector Shrivastav was all just a part of her plan to help the police arrest J.K
The fun begins when J.K. murders an honest crime reporter Mohammed Salim (Vijayendra Ghatge), who was about to expose JK's crime ring. Salim was married to Shaheena (Supriya Pathak), the daughter of Aslam Khan, and was also Vijay's brother-in-law. Vijay now decides to turn around his image as a cowardly cop. He openly defies J.K. Julie agrees to testify against J.K. Shalu provides ancillary evidence. And J.K. prepares for an all out war against Shahenshah/Vijay, Shalu and the lot of his enemies. At Salim's funeral, only one of the many witnesses of his death were present. He was about to reveal J.K.'s name, but a sharpshooter named Rana Pratap Singh shot him to death.
There is a veritable bloodbath on the streets as Inspector Vijay tries to get Julie into the courthouse. And there is a final showdown where Shahenshah reveals his secret identity and becomes the nemesis for all the culprits. To give himself a chance to escape, J.K. abducts Shalu. The showdown leads Vijay, dressed in Shahenshah's attire, chasing J.K. to the roof of the courthouse where J.K. is pleading his case, because his cover is blown. J.K. falls through a hole in the roof and is clinging on for dear life, with the whole court, judge sahab, audience and all looks on in astonishment. Vijay throws the noose down to J.K., and he gratefully accepts it. J.K., being the ruthless man that he is, attempts to attack Vijay. Vijay lets go of the noose, which slips around J.K.'s neck, and before the whole court, J.K. Verma is hanged, avenging Inspector Shrivastav and Salim the reporter, Shaheena's husband. Now with the biggest crime lord removed from his way, Vijay becomes the most successful officer in India after his father.
Tinnu Anand who had made the very successful film Kaalia with Amitabh, wanted to make another movie with him during the early 1980s. The story of Shahenshah was written by Amitabh's wife, Jaya Bachchan and further refined by Tinnu Anand's father Inder Raj Anand. Even though Anand signed up Bachchan in 1983, the film could not commence shooting because only three days before shooting was to begin in Bangalore, Amitabh fell seriously ill. After a thorough medical examination it was revealed that he had developed myasthenia gravis, a rare chronic autoimmune disease marked by muscular weakness without atrophy.
Due to Amitabh's illness and his commitments to other movies, the start of Shahenshah's shooting was delayed until 1985. By this time, the main heroine of the film, Dimple Kapadia, was replaced by Meenakshi Sheshadri. The now iconic costume that Amitabh donned in this movie weighed almost 18 kg, and despite his illness, Amitabh insisted on wearing the costume in all of his fight scenes. During shooting, Amitabh and Tinnu got into a disagreement over one particular scene in which Tinnu wanted Amitabh to wear his police uniform but Amitabh insisted on wearing a blazer instead. The argument got quite heated and with neither of the two willing to change his stance, shooting was temporarily halted. It was not until Tinnu's father, Inder Raj Anand, intervened and convinced Amitabh to wear the police uniform by explaining its significance in the scene that the shooting resumed.
The shooting eventually wrapped up in October 1987. Even though the film was initially planned to be released in November, the release date kept on being pushed back due to the threat of a boycott of the movie by some opposition political parties. These parties had had some conflict with Amitabh while he was a Congress MP and they maintained bitterness towards him even after he had retired from politics.
Shahenshah was finally released in February 1988 and went on to become a huge blockbuster earning over 6 crores by its fifth week. The film performed very well at the box office despite strong competition from other superhit movies like Tezaab and Qayamat Se Qayamat Tak, both of which were targeted towards the newer generation.