This movie is based loosely on Billy Hayes' book Midnight Express about his five year experience in the Turkish prison system. The movie was exaggerated for dramatic effect.
October 6, 1970. Opening scene has a xenophobic soundtrack of machine guns, Muslim prayer cries, and synthesizer music and a glimpse of Istanbul, Turkey during twilight with shots of the Bosphorus Strait, a mosque, and the downtown area with seagulls flying about . It is portrayed as a very spooky, forbidding place.
While finishing up on his vacation in Istanbul, Turkey, American college student Billy Hayes (Brad Davis) is in his hotel room and straps several pounds of hashish (about two kilograms) to his body. The film's soundtrack consists of an increasing heartbeat.
Billy is at the airport, nervous at being caught smuggling, goes to the washroom to wet his face and attempt to relax himself, and makes his way with his girlfriend, Susan (Irene Miracle), through customs. Billy perspires heavily, noticed by the middle aged, chain-smoking customs agent who checks his bag. After his bags are searched, both Billy and Susan board a shuttle bus to their plane. Billy smiles and is relieved thinking he is out of danger. However, as the bus pulls up to the plane, he notices that a large detachment of armed police and soldiers have taken up positions just outside the plane. Unable to detach and discard the hashish, and sweating heavily, Billy is arrested on the spot when he is frisked by a young Turkish policeman. Billy is taken away and back to security and searched, his bags being thoroughly searched and all items such as cigarettes, camera film, and toothpaste are searched and destroyed. He is forced to stand around in his underwear. Afterwards, the Turkish security chief of the airport makes his stand for several press photographs of him holding the confiscated drugs with the smiling customs officers and then slaps them around after Billy reveals more hashish in his boots they didn't find.
A little later, Billy is forced to stand naked with the customs officers staring and grinning at him and an unidentified southern American man (Bo Hopkins), presumably an agent with the DEA, walks in. He is calm and kind with Billy and takes him to a local police station where he is is interrogated where Tex translates for a local Turkish detective whom offers Billy freedom if he points out who sold him the hash.
He takes Billy downtown the next morning to the bazaar where he claims to have purchased the hashish and tells Billy that the recent terrorist airline hijackings have made the Turks much more fanatical about airport security and that the potency or type of drug that Billy was caught with doesn't matter: the Turkish government wants to appear tough on smuggling. Billy is at the restaurant that seems to be a popular place with young American hippies, where the sale happened and tries to run from his security escort. He is quickly caught by Tex himself, whose previously friendly attitude suddenly changes for the worse as he his holding a gun to his head.
During his first night in holding, Billy has his hair cut short, put into a filthy cell by a trustee (Paolo Bonacelli) that refuses to give him a blanket for warmth because he's not selling at the time, then sneaks out of his tiny cell and takes a blanket in storage. He is later rousted out of his cell by the trustee and taken to a large guard resembling a picasso bull named Hamidou (Paul L. Smith, who later played Bluto in Popeye), the chief of guards, who takes him to another filthy room, the basement, trusses Billy's ankles in the air and hits the soles of his feet repeatedly with his club for stealing the blanket as well as hitting a trustee. Billy's feet swell immensely and he is left in horrific pain.
However the next morning, a small group of prisoners, Jimmy (Randy Quaid), a towering, dumb, and hot-tempered American, and Erich, a kindly Swede, get him on his feet and walking (they tell him his feet will continue to swell and his recovery will be longer if he doesn't move around). Jimmy was sentenced for attempting to rob a mosque and Erich was busted for smuggling about 100 grams of hash and given a 12-year sentence. Jimmy is quite sure Billy will receive a stiff sentence, but Erich remains optimistic that he just needs a good lawyer and to talk to the Englishman Max for a lawyer. Jimmy shows Billy around how to navigate the minefield of the prison and not to trust any of the Turks, being a foreigner. The prison resembles an old barracks from the 1800's.
Billy is introduced to Max (John Hurt), is a bespectacled, introverted, unkempt, 30-something junkie uninterested in small talk that injects himself with "gastro" a stomach medicine with codeine and has been in prison the longest for drug dealing (seven years and counting), while Erich has already served four years and Jimmy around three. Billy and Erich are conversing with him to get a lawyer and Max is in a haze telling Billy about the Turkish justice system and that all Turkish lawyers are crooked and that he just needs to escape the best way he knows how, to catch the "Midnight Express", a train that doesn't stop at the prison. He refers to him a lawyer named Yesil that got off a Frenchman for smuggling 200 kilos.
A few weeks later, Billy's father (Mike Kellin) arrives and embraces him forgiving his mistake and introduces him to Stanley Daniels (Michael Ensign) of the American Consulate and his requested lawyer Yesil to defend him. Yesil is a fat, shifty, greasy-haired, chain-smoking, ever smiling man with gold teeth that promises Billy to get him the right court and judge and not to worry. Their goal is to get bail for Billy and a fake passport to get him across to Greece to leave.
Billy appears before a local Turkish court before a panel of three judges to hear his case and defend him. But Billy's shifty and uninterested lawyer does little to combat the charges brought by an angry prosecutor, who wants Billy charged with more than possession: If Billy is charged with smuggling over mere possession, his sentence will be heavier. After the three judges deliberate for an uncertain amount of time, Billy is sentenced to serve a prison term of four years and two months for possession of hashish at the Sagmalcilar Prison. Billy and his father appear devastated while his defense lawyer argues that it is a good thing because the judges (sympathetic to Billy) turned down the prosecutor's request to convict Billy for smuggling or impose a life sentence in order to make an example of him. Billy's father gives him a care package of snacks, cigarettes, writing paper, toiletries, and loses his temper that he's unable to get him out of prison. He warns Billy not to do anything stupid and that they can play with his sentence. They tearfully depart.
Over the next several months, Billy slowly adjusts to prison life. Jimmy gets stabbed in the behind for treating a Turkish prisoner badly and Hamidou beats several of the young boys on their soles believing to have raped a new young inmate, with his two pudgy sons looking on and him warning them about what happens if they break the law. He is also told about another prisoner named Rifki, the trustee, who informs on other prisoners for unheard-of privileges and favors and has a special distaste for foreigners. Rifki also sells watery tea, low-grade hashish, steals from his fellow inmates, and seems to have an unlimited (for incarceration) supply of money to bribe the poorly paid guards. When Max offends Rifki, the informant kills Max's pet cat.
In June of 1972, Billy meets with his lawyer Yesil again with Yesil assuring him of convincing Turkish officials to lose his records before the high court in Ankara can review his case for the right amount of money. Billy is bored and uninterested at Yesil's visit feeling it's all empty promises.
Jimmy shows Billy and Max blueprints to the prison of catacombs underneath to escape by scraping the mortar off and go underneath or simply climbing over the wall. Max dismisses Jimmy's idea as foolish and Billy does not want to risk trying to escape fearing that if he's caught it will add years to his sentence. An angry Jimmy decides to go ahead with it himself, being caught and badly beaten with a leather strap by Hamidou and sent to the sanitarium.
In June of 1974, Billy's friend, Erich, is granted transfer to prison in his home country, more than likely leaving there after a short term because of Sweden's lenient laws, and leaves the prison after serving around eight years. Billy farewells with him and marks down his prison time to 53 days.
After almost four years in the prison, Billy is informed that his case will be reviewed again. Thinking he's being let go early for good behavior, Billy rushes to meet with Stanley Daniels, the representative from the US ambassador's office in the Turkish capital city of Ankara. However, the representative has bad news; the High Court in the Turkish capital of Ankara has heard a different argument from the prosecutor who has appealed the four-year term verdict, and is seeking to charge Billy with smuggling hashish and make an example of him. The so-called double-jeopardy law of U.S. justice does not exist in Turkey. Any accused can be tried more then once for the same crime on appeal or should new evidence surface.
At another courtroom hearing, a distraught Billy rails against the three judges, the prosecutor, his own lawyer, the Turkish legal system, and the nation of Turkey itself. Speaking through a translator, with a mixture of anger and pity in his voice, the chief judge tells Billy that his hands are tied by Ankara and has no choice but to give him a life sentence. Billy is given a minimum sentence of 30 years, with time already served, for smuggling of hashish.
A saddened Billy sits in his cell with a sense of hopelessness that night, but now wants to go forward with Jimmy's original plan of escape. The stones used as walls in their section's kitchen are cemented in place with mortar that has weakened greatly in the dank conditions. Jimmy, Billy and Max discover two such stones and are able to remove them, finding a shaft behind them that leads to a system of flooded catacombs under the prison. The three of them spend two nights and hours searching for an escape route and seem to have found it once they remove a stone that has been saturated with water for decades. However, once they do go underneath, it turns out the Turks have long since blocked off every tunnel. The three give up and replace the stones.
Rifki finds their secret in the kitchen the next morning after their unsuccessful escape attempt and immediately tells Hamidou. Hamidou suspects Jimmy of being responsible after what happened the first time and drags him off for punishment once again.
Billy and Max figure out a revenge scheme: they find Rifki's stash of hidden money and destroy it by burning part and boiling the other part. In retaliation, a raid is performed by Hamidou and Rifki plays a charade with Hamidou and frames Max for hashish possession. Hamidou has Max dragged off for punishment like Jimmy was. Billy loses it after all he's been through and savagely attacks Rifki in the washroom, chasing and beating the traitor until he bites out the man's tongue out. Billy has snapped to this point and taken away by guards, beaten, and sent to the prison's insane asylum.
In October 1975, Billy has now been reduced to a catatonic and unkempt mess of a man in prison's ward for the insane where he wanders in a daze among the other disturbed and catatonic prisoners, many of which look retarded. Max is running from guards for an unknown infraction and is grabbed by Hamidou and thrown across the place being severely injured. His activities seem to consist solely of walking in a circle around a pillar with other prisoners. One day a prisoner, named Ahmet, a convicted child rapist and college-educated philosopher tries to talk to him about "bad machines" to no avail.
A group of men are doing their morning Muslim prayers and the guards hit the inmates with their sticks waking them up out of bed. Billy is hit, howls out of sleep, and horrified, making it evident he is suffering badly from PTSD.
After 5 years, Billy is visited by Susan, who tells him that senator's are trying to work on his case to get him out, pleads with him to put himself together and get out of there unless he wants to die, and passes him a photo album of his family and tells him it has a picture of his "good friend, Mr. Franklin, from the bank". Susan, feeling devastated at Billy's horribly bedraggled state, also opens her blouse so Billy can masturbate. A guard takes him away with Susan even more devastated.
The next morning, Billy is walking the pillar in the opposite direction, which is forbidden in the Muslim code. Ahmet meets him telling him it's wrong that a good Muslim always walks right. His words seem restore some of Billy's sanity and Billy tells him that he himself is the man that makes the machines. Ahmet walks away horrified.
Billy goes into the filthy sanatorium washroom and inspects the album closely, finding numerous $100 bills hidden inside totaling around $2,000 in cash. He passes by an almost dead Max to hold on and stay alive that he's leaving and will come back for him. Max wakes up and is somewhat conscious.
Billy sees Hamidou taking a restraining belt off a now dead inmate and about to leave. He approaches Hamidou with part of the money and tries to bribe his longtime enemy to take him to the sanatorium that Jimmy had spoken about where the guards are more lax in their duties. Hamidou accepts Billy's bribe to take him there, but instead takes him elsewhere. He's drags Billy to a large dressing room filled with guard uniforms and with pegs set into the walls. Hamidou beats Billy, chats with him about how he's fed up with him, and attempts to rape him when Billy suddenly rushes to Hamidou and pushes him forcefully backwards. Hamidou, flailing and trying to regain his footing, slams into the wall, driving a clothes peg into the back of his head, dying instantly. For a short time, Billy considers shooting the dead man with his sidearm but decides not to.
Billy dresses himself in a guard's uniform and reclaiming his money, walks through the prison unnoticed to the front door. As he walks down the stairs, another guard stops him and throws him the keys to the door telling him (in Turkish) to remember to lock up when he checks out. Billy walks out to the street, slowing down only briefly when a police jeep rushes past him. He runs away, the frame freezing on him as he takes a victorious leap. A title card tells us that on the night of October 4, 1975, Billy was able to cross the Turkish border into Greece and flew home to the United States three weeks later. The final shots of the film before the closing credits show Billy reuniting with his family and Susan. In the original version, it was stated after having shown the movie to the Cannes film festival, there was a demand for exchange of prisoners in Turkey to be brought to America.