Paul Atreides had two children, Leto and Ghanima. At the end of Dune Messiah, Paul walked into the desert, a blind man, leaving the children in the care of the Fremen while their aunt Alia rules the universe as regent. Awoken in the womb by the spice, the children are the heirs to Paul's prescient vision of the fate of the universe, a role that Alia desperately craves. House Corrino, the previous imperial house, schemes to return to the throne, while the Bene Gesserit make common cause with the Bene Tleilaxu to destroy all three "abominations".
Warning: Wikipedia contains spoilers
It is nine years since the Paul Maud'dib walked away into the desert. The ecological transformation of Dune continues apace, some of the Fremen are even doing without stillsuits, because the climate is so much more friendly. Fremen have started to move out of the Sietches and into mud hut villages. Millions of Fremen have no experience life off planet and this has opened their minds to possibilities. It is a time of great social change, and spirits are running high. The book opens with a council meeting between the high council. Those present - Alia, Duncan, Irulan(who since the death of her beloved Paul, has thrown in with the Atreides) and Stilgar - lament the fact that they have lost the initiative in the political arena. Paul Atreides had been powerless to control the Jihad, and with only the shadow of his religous mantle they are even less capable of controlling it, they finding themselves a situation reminiscent of riding a maddened elephant.
The two young children of Paul, Leto and Ghanima, are not normal nine year old children. Like Alia they had consciousness before birth, and remember their lives of their ancestors. The children are very troubled; they have come to the conclusion that Alia has become possessed by one of her ancestors, and as well as hurting at her awful predicament, fear terribly that they will succumb too. Also they are aware that the transformation of Dune will kill all the sandtrout and bring to an end the Giant Worms, a fact that only they and Alia knows.
Leto has an additional fear as well, he has started have dreams which he is coming to believe are ones of prophecy like those of his father. He also has the added pressure that Alia is pushing him to enter into the spice trance, in order unlock the door to prophetic visions, because she feels the need for such visions to rule the empire.
Things have reached a heightened note of tension because Jessica is coming to Arrakis to visit her grandchildren from her self imposed retreat on Caladan. Alia fears this utterly because she has indeed become possessed by the Baron Harkonnen, and is sure that her mother will notice, despite her erroneous belief that no-one has yet recognised the change in her. The Baron is leading her far away from the Atreides way of doing things, she has even taken a lover behind Duncan's back, a priest called Javid.
Out in the desert, a new religious figure has arisen among the Fremen, who preaches against the injustices of the religious government and the changes among the Fremen. He is called 'The Preacher', and some even believe he is actually Paul Atreides.
Meanwhile on Salusa Secundus the Corrino's are plotting again for power. Wensica, younger sister of Irulan, rules in the name of her son, Farad'n. She has plans of Empire for her son, and has hatched a plot to assassinate the twins.
Jessica arrives on the planet wary. She has been approached by the Bene Gesserit, and made to recognise the duties she has been ignoring. She makes her peace with the sisterhood, and is apparently welcomed back. With the warnings of the Sisterhood, she arrives back on Arrakis fearing that her Alia and her grandchildren have fallen into abomination. At the landing field she meets Alia, and recognises straight away that for Alia at least this is true. Alia is actually relieved by this, the time of concealment is over.
So we have a situation where everyone but Stilgar and Duncan Idaho have plans for the twins, but what no-one realizes is that the twins are pawns of no-one, and have plans of their own.
Jessica arranges a meeting with Ghanima. She sees no signs of abomination on either of the twins, but Leto shows signs of concealing something so she excludes him from the meeting. Jessica and Ghanima meet truly as grandmother and granddaughter, and do not hide the love between them, straight away find common cause. Jessican learns the twins are aware Alia has fallen into abomination, and their speculation that the undergoing the spice trance was Alias fatal mistake. She quickly confirms that Ghanima is not possessed but still worries about Leto. Ghanima calms her fears on that score, but Ghanima admits she worries for him.
She next talks to Leto. Their meeting is far more confontational. Leto controls the path of the conversation. Firstly he reveals to her how she had been manipulated by the Bene Gesserit, into coming to Arrakis and by the conditioning of her training. Leto orders her to let herself be kidnapped.
Leto talks to Stilgar and shakes up his universe. First he shakes ups Stilgars presumptions about him, Leto, by pointing out his memories and experiences go back far further than Stilgar. That he is most suited to be Emperor. He lets Stilgar know that he is starting to have dreams of prophecy. He tells Stilgar that in one future, he is killed at the spot they are talking. He orders Stilgar to flee with Ghanima into the desert if that happens. He also undermines Stilgar support for Alia, pointing out the flaws in her thinking, and the destructive place it will take the Empire and the Fremen, and the fact she is no longer his friend. He makes Stilgar realize that change is coming, and that traditional thinking was not the absolute guide Stilgar had thought it was.
At Jessicas first reception with Alia, an assassination attempt is made on Jessicas life by minions of Alia/The Baron. Only with the help of old fedaykin companions of Paul is Jessica able to escape into the desert. A rebellion breaks out among the Fremen inspired by this latest injustice, a rebellion made all the more dangerous and legitimate because the mother of Maud'dib supports it and so counterweighs Alia's own religious mantle. Jessica presses for Alia to be tested for possession.
At this time the twins choose to go out into the desert during the night. They do this even though they are aware that an attack willl be made on their lives, prewarned by a vision of Letos. The twins are attacked by two Laza Tigers, but they manage to kill the tigers, despite an injury to Ghanima. They then institute their own plan, Ghanima uses a hypnotic technique to convince herself that her brother was killed by the tigers, and goes back to Sietch Tabr griefstricken. Ironically as a beneficial side effect of this hypnotic technique she finds that it gives immunity from the voices within.
Meanwhile Farad'n has been told about the assassination attempt on Leto and Ghanima. He is shocked, not so much at the attempt, but at the clumsiness of it. But now he realizes the stakes involved.
Duncan meanwhile is aware that Alia is cuckolding him with Javid, which he naturally enough he finds heartbreaking, but he is utterly distraught with the realization that Alia is suffering from possession. He comes to realize that Alia is possessed when she suggests to him to get rid of Jessica. He realizes that on top of the fact that it is not the sort of behaviour an Atreides indulges in, he also realizes that if she was in contact with her mother within her mind she would not even consider this, so obviously she is prevented from this. Therefore possession. Alia implies to Duncan she would like her mother to disappear. Duncan offers to make it happen, and Alia 'reluctantly' agrees.
Duncan does make Jessica disappear but not as Alia expects. Duncan 'kidnaps' Jessica and takes her to Salusa Secundus, where she is to meet an interesting pupil. Jessica unsure of his motives asks who he serves. He says the Preacher. She asks if it is her son. His answer 'I wish I knew.'
Duncan and Jessica arrive on Salusa. Farad'n informs Jessica with some compassion that her grandson has been killed, though her granddaughter survived. We learn that the Bene Gesserit have formally protested to CHOAM at the Corrino assassination attempt. Farad'n uses the situation to force his formal confirmation of power from his mother in front of witnesses. Jessica and Farad'n make a bargain. Jessica will announce that she has come to Salusa of her own free will. Farad'n will send his mother off into exile. Jessica will train Farad'n in the ways of the Bene Gesserit. The Bene Gesserit promise Farad'n the throne with Ghanima as his mate. Duncan attempts to commit suicide when he hears that Alia has offered herself as wife to Farad'n, and offer Farad'n was not foolish enough to accept.
Alia spies on one of the Preachers speeches, in order to discover if it is really her brother, and she is shocked to discover that it really is.
Duncan and Jessica talk. Duncan Idaho formally withdraws from Atreides service. He insults Jessica and advises Farad'n that he should send Jessica back to the Bene Gesserit.
Leto meanwhile goes off seeking his father. Leto finds Jacruntu, but as he tries to infiltrate the camp he is captured. When he wakes up he discovers that he has been captured by Gurney Halleck, and a certain Namri. They tell him he has come to school. He is forcibly injected with Spice Essence, and so undergoes the Spice Trance. Gurney thinks is on Jessica's instructions but it is really Alia's.
Leto goes through the transformatory experience. Leto experiences fascinating and overwhelming oracular visions of possible futures. He nearly loses his mind, but in the end he manages to get through it. In his vision of the Golden Path, he sees the way out of his dilemma. He does this by seeking allies within the ancestors for the future, principally and old ruler from the distant path - Harum. These allies within join with him in order to make the Golden Path happen. After his experience he is tested by Namri, and survives the first test. Before they can test him again, he escapes into the desert. When they discover Leto gone, Namri and Gurney argue, Namri tells Gurney that he has been serving Alia, not Jessica as he thought, and attacks him. This was a serious mistake, Gurney kills him easily, and silently, and escapes from the Sietch.
Alia and Duncan meet up again. Alia is shocked to learn her mother is not dead and is indeed training Farad'n. She is not aware that this was deliberate 'treachery' on Duncan's part, instead she thinks it is his innocence, that led her to take her literally. However, Alia/The Baron decides to arrange an accident for Duncan, seeing him as too dangerous. Duncan sees through her plotting easily, pretends to agree with her plans, and then escapes in a thopter.
Leto's escape is not a complete one. He discovers that Namri had cut his heel pumps and he has lost half his water. So he goes to Shuloch on his own terms. He meets a party of the men of Shuloch, and through subterfuge gets Muriz the leader to offer him hospitality rights.
Leto discovers at Shuloch that these Fremen are trapping Giant Worms for sale and transfer off world. This presents him with the opportunity to make his vision real. Leto makes the sacrifice and chooses to accept a worms body. He dives into a pool of sandtrout and form a living skin around him. He sees the way to merge his body's chemistry with the sand trout and does so. He then explores the desert with his new near invulnerable body, he can speed through the desert at tremendous speed and has the strength of many men. Leto is no longer fully human, and his powers have become superhuman.
Leto travels through the desert until he comes across the Preacher. He puts himself across the path of the worm, The Preacher and his guide are travelling on. Despite the guides urging the Giant worm refuses to ride over Leto, recognising the sandtrout on Leto's body. Leto greets his father. it is a terrible moment for Paul Atreides, facing a son who had the bravery to do what he would not.
Stilgar has been maintaining his neutrality between Alia and the rebels. But Duncan Idaho deliberately provokes Stilgar into a rage bu killing Javid, and then insulting Stilgar, and the maddened Stilgar kills him. This forces Stilgar to become a rebel, which is the only way he can protect Ghanima from Alia.
Alia hears of Duncan's death. She does the expected Fremen thing and orders her forces to find Stilgar and kill him. After doing this, and much to the Baron withins surprise she grieves for Duncan, and for a moment returns to being just Alia.
While conflict continues between the rebels and the loyalists, and Stilgar flees from hiding place to hiding place - Leto spends his time moving through the desert wrecking the ecological transformation of Arrakis, by destroying the reservoirs(Qanats) that were being used to feed it. He is seen as some desert demon. Leto makes his base at Jacruntu. He kills all who oppose him, and they accept his orders with religious awe, he wears the skin of Shai Halud.
After long conflict, Alia manages to recapture Ghanima through treachery. She offers Ghanima as bride to Farad'n. Ghanima agrees to this wedding, but only so she can get close enough to Farad'n to kill him. Farad'n arrives on Dune for the ceremony.
Leto makes his move. He goes to Arakeen as The Preachers guide. Paul as the Preacher makes a virulent speech against Alia, which provokes a pries to kill him in front of the eyes of Alia, Farad'n and Jessica. At this point Leto arrives with Ghanima to everyones shock. He says the keywords to awaken Ghanima's secret memories. She asks him if the plan worked, and he says well enough. Alia orders the guards to seize him, but he throws them aside, and they are too scared to enter the room. Leto advances on Alia, and offers his help to fight the inner lives within. This causes Alia to breakdown, she fragments totally, and different voices in different languages pour out of her, until finally the Old Baron takes control. He is confronted by Leto and Jessica, and they urge Alia to fight him. she does so by hurling herself out of the window to her death.
Leto makes himself emperor. He uses his new near invulnerable body to establish himself as undisputed Emperor, scaring all the Fremen naibs into submission. He ate poisons, lifted heavy weights, took wounds from blades in order to prove this power. In the end they all came to Arakeen to surrender leadership to him.
Leto reveals the Golden Path to Farad'n. Farad'n accepts a post at Leto's empire. Gives Leto his legions of Sarduaker, and agrees to marry Ghanima in secret.