The movie starts off in Sudan 1976, when a young Samir Horn performs namaz with his father and plays chess till the father needs to go. As Samir watches from a distance, his father gets into a car, which explodes. Samir watches in horror at the burning wreckage.
Many years later, in Yemen, Samir Horn (Don Cheadle) drives towards a meeting with some Islamic terrorists. At the same time, a bunch of Yemeni soldiers, accompanied by FBI Agents Roy Clayton (Guy Pearce) and Max Archer (Neal McDonough), prepare to storm the terrorists' safehouse.
At the safehouse, Samir meets an extremist named Omar (Saïd Taghmaoui), who seems a bit confrontational. Samir is there to meet Ahmed, the "head terrorist" to sell Semtex, which he has in his car. Ahmed enters and greets Samir warmly and tells stories of Samir's resourcefulness in Afghanistan. Just then, the Yemeni soldiers attack the safehouse, killing many terrorists, including Ahmed. Samir, Omar and others are arrested and taken to a Yemeni prison.
Samir, being a US citizen (Sudanese father, American mother), is interrogated by the FBI agents, Clayton and Archer. He refuses to divulge any information on anyone, and gets punched in the stomach by Archer. Clayton tries acting the "good Fed", but to no avail. Samir is thrown in a Yemeni jail.
In jail, Omar calls him a "traitor", but he denies it. He performs namaz regularly, as Omar watches. One day, during lunch, he witnesses an inmate bully an older inmate. When he helps out the older inmate, the bully and his cronies attack Samir. Samir puts up a brave fight, but gets a beatdown. The guards come to his rescue and put him in solitary for a while. When he is released, the bullies come back to finish what they started. This time, Omar has Samir's back and intimidates the bullies.
Samir and Omar become friends and play chess in their free time. Omar respects Samir because he's an intellectual, more than a soldier (read, martyr). One day, thanks to some friends outside, Omar, Samir and others escape from the prison.
In Madrid, Spain, a suicide-bomber tries to blow up his explosives-laden car, but due to a malfunction, gets cold feet and runs. The bomb explodes seconds later, killing eleven people. He is caught, however. Clayton and Archer fly to Madrid to interrogate him. Clayton threatens to expose his survival and capture (which pretty much means, he talked), which would get his family in trouble. So the failed suicide-bomber agrees to cooperate. He tells them that a mysterious terrorist named Nathir is behind the bombing. He also tells them that many wannabe martyrs are in the US, on fake student visas. Homeland Security immediately starts investigating all student-visa-holders in the US. Meanwhile, we see a few of the wannabe martyrs - a black businessman, a couple of women, a coffeeshop clerk, a mechanic and others.
Samir is taken to a safehouse in Marseilles, France, where Omar offers Samir a chance to join them. Samir accepts. He is introduced to Fareed, a Pakistani. Samir is none too happy to be offered wine by Fareed, who says he does it to blend in with the enemy and that it is allowed by the Holy Quran. Samir corrects him that you are allowed to say you're not a Muslim to save yourself, but that's all. However, Fareed forces him to drink the wine.
Soon, they start plotting and teaching young Muslims about jihad and martyrdom. They get a young man ready to martyr himself. Samir feels he's too young and inexperienced, but he is vetoed by the others. However, the young man compromises the mission by informing his cousin on the phone (which the FBI tap). As a result, the young Muslim is murdered (much to Samir's displeasure) and the mission is called off.
Meanwhile, Clayton and Archer find out more on Samir Horn. Apparently, he was in the US Army and helped out the Mujahideen in Afghanistan, during the Russian invasion. Finding his roots there, he stayed on. The agents go to France and speak to the French intelligence liaison, who informs them about the young man's death. They find out that Samir has a girlfriend, Chandra Dawkin, in Chicago. They speak to her, but she's non-cooperative. They put a tail on her.
In France, Omar tells Samir that Nathir is unhappy about the failure. Samir suggests that they blow up the US Embassy in Nice, France. Since they have no martyrs ready, Samir suggests remote detonation. He sets up the bomb, using Semtex and RDX. The Embassy is having repairs done, and have a small staff as a result. Disguised as a construction worker, he places the bomb inside and walks out, after quitting time. A short distance away, he detonates it.
Returning to Fareed's safehouse, he is welcomed with congratulations. According to the news, 8 people died. Samir is shocked at the death toll. He acts as if he's unhappy that ONLY 8 died, so that the others don't suspect. He meets with his contact, Carter (Jeff Daniels), in a deserted parking lot. Carter tells him that they had put two bodies from the morgue inside the embassy prior to the bombing. However, some workers were working late and were killed in the blast. Carter tries to console Samir, but Samir is distraught. He returns home and breaks down and prays for Allah's forgiveness.
The Feds find out that the bombing was a remote detonation and not a suicide attack. Clayton asks to look at the security and CCTV tapes within a hundred metres of the blast. To their consternation, they see Samir in the footage. They speak to Chandra and Samir's mother about him, but get nowhere.
Thanks to Samir's success, Omar and Fareed take him to meet Nathir in Canada. They talk awhile about the "evil US" and other crap. Then, Nathir and Fareed let them in on the main mission - to make Americans feel unsafe anywhere by blowing up 50 buses in Chicago. And Samir will be the pointman on this mission, as he can easily pass for an American. Samir accepts it gladly. He meets with a money launderer, who gives him money for the mission.
The Feds get a video call from their French counterparts, talking about the hawala (money laundering) and that they have a suspect. They give them a composite sketch of Fareed, who is suspected of being in England.
Samir enters the US through Canada. Omar enters the US through Mexico, in a truck. Meeting in Chicago, Omar and Samir unpack the plastic explosives from the juice boxes in the truck. Samir comes up with an idea for communicating with the martyrs. They'll set up email accounts for all and keep the passwords. Instead of sending emails, they'll save them as drafts for the martyrs to check later when they login. Omar okays the idea and gives him only 10 of the bombers to meet. The rest will be contacted by others.
One of the FBI Arabic translators turns out to be working for the terrorists. He finds out that Fareed is in danger of being caught, so he calls one of Omar's men to warn him. Omar's man in England manages to get Fareed out, but gets gunned down by the cops. Meanwhile, the Feds raid the hawala operator's place and arrest him. He breaks during interrogation and fingers Samir as the one he gave the money to.
In a seedy motel, Samir meets Carter in secret. Carter gives him an encrypted cell phone. Carter tells Samir to go through with the plan so that they can get to Nathir. Samir is conflicted. Carter reminds Samir who he works for. Samir replies simply, "I work for God."
With the bombs assembled, Samir goes around the city to meet the different martyrs scattered around the city. He gives them different items, which he has rigged, for them to detonate when the time is right. He goes see his girlfriend, Chandra, while she jogs through a park. He tells her that everything the Feds said about him is true and to forget about him. The FBI tail on her sees him and contacts Clayton and Archer, who are on a plane. Clayton orders the tail to stay on him, until they arrive. Samir notices the Feds tailing him and tries to get away. Reaching Chicago, Clayton and Archer join the pursuit. Samir ducks into a black-dominated housing project. The tailing Feds wait for their backup outside the project. Clayton and Archer enter the building. Archer goes up, while Clayton goes down to the basement. In the basement, Samir attacks Clayton and disarms him. He holds Clayton's own gun on him. Making Clayton pray ("Our Father who art in Heaven..."), he knocks him out and flees the scene. Clayton and Archer wonder why this remorseless terrorist didn't kill him on the spot.
As Samir waits in a parking garage for Omar, Carter arrives and surprises Samir. Carter's there to get Samir out. But it's too late. Omar's car enters. In order to prevent suspicion, they pretend to fight. Carter runs as Samir fires in the air towards him. Unfortunately, Omar gets out of the car and shoots Carter in the back, as he runs. Going up close to him, as Samir watches helplessly, he shoots Carter in the head. Grabbing Samir, he ushers him into the car as Samir stares speechlessly at his handler's body. Omar asks what the hell is going on. Samir tells him that he had gone to see his girlfriend, but was tailed by the now-dead attacker. They've only managed to contact 30 martyrs, instead of 50.
They go to Fareed's house. They tell Fareed about the dead man. However, Fareed already knows that Samir had gone to see Chandra Dawkin. Fareed suspects Samir of being an informer. Things aren't looking too good for Samir right now as he's led out of the room. Omar argues in favour of Samir, but Fareed is resolute. When there is doubt, it should be eliminated.
At the parking-garage-turned-crime-scene, Clayton and Archer see that the dead man is Carter, an independent contractor, who they had met earlier in the movie, during an intelligence briefing. Going back to HQ, Clayton suggests putting Samir Horn on the High-Value List.
At Fareed's safehouse, Samir and Omar look to be playing their last game of chess. Omar lets Samir win and Samir sees it. He knows he's about to die. As Omar suggests they pray, Fareed enters and tells them that Samir is on the FBI's High-Value List, which means that they want him dead as much as he wants them dead. This lets him off the hook and back in the terrorists' good graces. Sitting in an Internet cafe, Samir and Omar prepare to draft the emails to the martyrs. Samir unhooks the computer's net connection, causing it to hang. Acting frustrated that he now has to boot the computer, he asks Omar to get some coffee from across the street. When Omar goes, he connects the cable again and emails Clayton. By the time Omar returns, Samir finishes drafting the email to the martyrs. Before Omar can sit, Samir drags him out, saying he's done.
When Clayton gets the mail, he's shocked to see Samir's mail, telling him that they are headed to Halifax, Nova Scotia, and that he knows he's on the High-Value List, and that there is a leak in the FBI. Clayton tries to reply asking for more info. However, Samir's email address was encrypted, so the email doesn't go out. He and Archer prepare to go to Halifax.
Samir and Omar go to Halifax, Nova Scotia, where they rejoin Fareed and Nathir in a cargo ship, awaiting news of the bombings.
We see the martyrs preparing themselves for their "destiny". They clean themselves, pray, check the rigged item given to them by Samir and head out to the bus station. Each one gets on the bus designated by Samir, waiting for the correct time.
Clayton and Archer arrive in Halifax and are taken to the docks, where they find out that only one boat is headed for international waters. They head out to search it. When they find nothing, they are informed that there is another cargo ship headed to Yemen.
In the cargo ship, Samir feigns queasiness and goes out accompanied by Nathir's head of security. Finding out about other guards on the boat, he kills the man and takes his gun. He prays to Allah, almost like a final prayer (similar to what the martyrs are praying). Then he walks into the cabin where Nathir is and shoots Fareed point-blank. Nathir tries to talk, but Samir executes him as well. Omar takes cover and fires at Samir. In the midst of the standoff, Samir tries to talk some sense into Omar, saying that Fareed and Nathir were evil and not true soldiers of Islam, that they corrupted the Prophet's teachings... Omar doesn't want to listen. He says that the mission is still on.
Back to the martyrs, each one gets ready to push the button. One-by-one, they all stand up and scream out "Allah-u-akbar!" and push the button. Only too late do they realise they're all on the same bus. On a country road, the bus explodes, killing them and a few other civilians as well.
Samir tells Omar that he had put all the martyrs on the same bus. Omar is livid. Samir walks into the open and discards his gun. Samir walks towards him, almost ready to kill him. Just then, the boat is raided by an FBI SWAT team. Omar turns his gun towards them and pays for it, getting riddled with bullets. Samir gets injured in the shootout. Luckily for him, Clayton yells out for them to hold fire. He sees Samir is wounded, but not seriously. He calls for a medic.
Some time later, Samir is released from hospital. Clayton is outside, waiting to meet him. He tells him that the country owes him a debt of gratitude for what he's done. Samir isn't very happy though. His heart still hurts for the innocents who died because of him. He quotes from the Quran that he who kills one, kills all mankind. Clayton tells him that he who saves one, saves all mankind. He calls Samir a hero. Samir leaves.
The movie ends with Samir performing namaz at a mosque.