Charlemagne's army is fighting the Muslims in Spain. They have been there for seven years, and the last city standing is Saragossa, held by the Muslim King Marsile. Threatened by the might of Charlemagne's army of Franks, Marsile seeks advice from his wise man, Blancandrin, who counsels him to conciliate the Emperor, offering to surrender and giving hostages. Accordingly, Marsile sends out messengers to Charlemagne, promising treasure and Marsile's conversion to Christianity if the Franks will go back to France.
Charlemagne and his men, tired of fighting, accept his peace offer and select a messenger to Marsile's court. The protagonist Roland, Charlemagne's nephew, nominates his stepfather Ganelon as messenger. Ganelon, who fears being murdered by the enemy and accuses Roland of intending this, takes revenge by informing the Saracens of a way to ambush the rear guard of Charlemagne's army, led by Roland, as the Franks re-enter France through the mountain passes.
As Ganelon predicted, Roland leads the rear guard, with the wise and moderate Oliver and the fierce Archbishop Turpin. The Muslims ambush them at Roncesvalles and the Christians are overwhelmed. Oliver pleads with Roland to blow his horn to call for help, but Roland tells him that blowing his horn in the middle of the battle would be an act of cowardice. If Roland continues to refuse, Oliver will not let Roland see his sister again whom Roland loves the most. However, Archbishop Turpin intervenes and tells them that the battle will be fatal for all of them and so instructs Roland to blow his horn oliphant (the word is an old alternative to "elephant", and was used to refer to a hunting horn made from an elephant tusk) to call for help from the Frankish army. The emperor hears the call on their way to France. Charlemagne and his noblemen gallop back even though Count Ganelon tries to trick them.
The Franks fight well, but are outnumbered, until almost all Roland's men are dead and he knows that Charlemagne's army can no longer save them. Despite this, he blows his olifant to summon revenge, until his temples burst and he dies a martyr's death. Angels take his soul to Paradise.
When Charlemagne and his men reach the battlefield, they find the dead bodies of Roland's men, who have been utterly annihilated. They pursue the Muslims into the river Ebro, where the Muslims drown. Meanwhile, Baligant, the powerful emir of Babylon, has arrived in Spain to help Marsile. His army encounters that of Charlemagne at Roncesvalles, where the Christians are burying and mourning their dead. The Franks fight valiantly. When Charlemagne kills Baligant, the Muslim army scatters and flees, leaving the Franks to conquer Saragossa. With Marsile's wife Bramimonde, Queen of Saragossa, Charlemagne and his men ride back to Aix, their capital in France.
The Franks discover Ganelon's betrayal and keep him in chains until his trial, where Ganelon argues that his action was legitimate revenge, not treason. While the council of barons assembled to decide the traitor's fate is initially swayed by this claim, partially out of fear of Ganelon's friend Pinabel who threatens to fight anyone who judges Ganelon guilty, one man, Thierry, argues that because Roland was serving Charlemagne when Ganelon delivered his revenge on him, Ganelon's action constitutes a betrayal.
Pinabel challenges Thierry to trial by combat. By divine intervention, Thierry kills Pinabel. By this the Franks are convinced of Ganelon's treason. Thus, he is torn apart by having four galloping horses tied one to each arm and leg and thirty of his relatives are hanged. Bramimonde converts to Christianity, her name changing to Juliana. While sleeping, Charlemagne is told by Gabriel to ride to help King Vivien and bemoans his life.