In a strange faraway land lies the mysterious labyrinth called The Dungeon. A young boy, Aladdin, and his companion Alibaba, attempt to penetrate the secrets of The Dungeon and obtain the treasures rumored to be hidden there. Within The Dungeon, Aladdin meets many different people, and eventually discovers his destiny.
A young boy named Alladin asks his Djinn Ugo for a wish. Soon after, the boy crosses his path with Alibaba, a youngster who dreams to obtain power and wealth by clearing the mysterious dungeons arround the world and claim their treasures. Upon learning of Alladin's secret powers, Alibaba gets close to him trying to win over his favor, but he only manages to get his help when he finally assumes that his true desire is to overcome his own hopelessness. Alladin's wish is finally granted when Alibaba agrees to become his friend.
Morgiana have passed the previous six months traveling with a caravan, but just when she is about to reach her destiny, the city of Balbadd, where she hopes to take a boat to her homeland, she learns that the caravan will take another route because of a group of thieves is on their way. Morgiana decides to confront the thieves by herself and is defeated by a slave trader who paralyzes her with the poisonous claws of his eagle. Once again in chains, she wakes up near a scared child who was separated from her parents and when the slave traders learn that the girl is feverish, they decide to feed their beasts with her. Morgiana watches in horror as the child is about to be killed when she hears Goltas' voice urging her to fight back, and she breaks up her restraints with her power, protecting the girl and defeating the slave traders. Morgiana then reaches the cell where the other captives are being held just to find Aladdin among the prisoners. As the members of Morgiana's caravan appear to help her, they find the thieves and slave traders fleeing in fear of Ugo. After reuninting with the caravan, Morgiana learns from Aladdin that he is also going for Balbadd to meet Alibaba and she continues her travel to the city now accompained by him.
After escaping from Jamil and his slaves, Aladdin and Alibaba reach the dungeon's inner chamber. Soon after they are attacked again by Jamil and Morgiana. When Morgiana is about to kill Alibaba, Aladdin grabs a stone scepter and makes use of his powers to stop her, which propmts another Djinn named Amon to appears. Amon greets Aladdin and recognizes him as a Magi. Jamil urges Aladdin to recognize him as a king, just like his former teacher had foretold to him, but he declines. When the dungeon starts collapsing, the giant grabs Jaamil and dies with him after asking Morgiana to escape with Aladdin and Alibaba, who grabs all the treasure he can before the trio is teleported out of the castle. Morgiana wakes up in the outskirts of the city. So does Aladdin, but in an unknown location. Alibaba, with the treasure in his possession, ressurfaces where the now disappeared dungeon used to be and is greeted by the people of the city for clearing it. Unaware that Amon now resides within his sword, he asks himself about Aladdin's fate.
Alibaba and a slightly exhausted Aladdin enter a nearby dungeon. They manage to elude traps and confront monsters which they rely on the power of Ugo with a price of Aladdin's energy. Afterwards, they entered a passage that shoots fire and Alibaba called it the Dragon's Tail. Little they know that they were being followed by Judal, Morgiana and a hulking man armed with a sword. Judal confronts Alibaba and demands to deactivate the shooting fires on the passage and as Alibaba manages to deactivate the flaming traps, he was engulfed by fire and Judal continued their quest. Aladdin wakes up and searches for Alibaba by asking Morgiana. As Judal continues to berate Alibaba and Morgiana, Alibaba appears and stops Judal.
Three days after clearing the dungeon, Alibaba still had no news about Aladdin's fate. He is visited by Morgiana who thanks him for making use of the treasure he collected to free all slaves including her. Alibaba then decides to leave the city looking for his friend. Aladdin wakes up in a nomad village far away and is welcomed the Kouga Clan's leader, the Shaman Chagan. Hakuei Ren, third princess of the Kou Empire appears at the village to ask the clan to join the Empire, but Chagan declines her offer. Fearing that the Empire may eventually annex the Kouga by force, Aladdin pays a visit to the princess and she promises him to solve the matter without causing any deaths. Meanwhile, some women from the clan are kidnapped by slave traders, and a group of warriors set to rescue them, warned to not kill anybody in order to not cause a war. As Aladdin and Chagan wait for them to return, she tells him the story of how the Kouga were once the biggest empire in the world after a king chosen by a magi unified his people and formed the first nation in history. After the warriors return, bringing the women with them and having fulfilled the promise to not shed any blood, Chagan announces her decision to have the clan join the Kou Empire, but soon after she is killed by an arrow.
Aladdin and Morgiana come across a naked man who was robbed of all his belongings and accompany him to the city of Balbadd. There they learn that the man is no other than Sinbad, the king of Sindria. Sinbad has come to Balbadd to convince their rulers to reopen trade with Sindria, but they claim to have their hands full dealing with a group of thieves known as the "Fog Troupe" who is now being led by no other than Alibaba. Upon figuring out the thieves' next possible targets, Sinbad and his aide Masrur take guard in one place where his other retainer Ja'far, Aladdin and Morgiana guard the other. The Fog Troupe attacks subduing all resistance and just as Aladdin and Morgiana appear to fight them, Alibaba reveals himself before an astonished Aladdin.
As Aladdin rushes to take the Shaman to be treated, Hakuei learns that one of the soldiers was killed by an arrow from the Kouga Clan and leaves the army under command of her aide Ryosai to learn the truth about the attack. She comes across the clan who does not believe her words even after she had herself wounded after refusing to fight back. Chagan, who is brought there by Aladdin under her request, reaffirms her decision to have the Kouga become a protectorate of the Kou Empire and allows the princess to return. After Chagan expires from the wound, her spirit appears before Aladdin, who comfirms that he is indeed, a Magi. Hakuei returns to the camp just to find Ryosai and his troops ready for war. She learns that it was all a plot of his to have her killed and him take command of her troops. Hakuei and her assistant fight against the troops just to be defeated when her magic artifact runs out of Magoi, but soon after Aladdin appears and saves them. Aladdin uses his powers to have Paimon, the Djinn inside Hakuei's artifact materialize and learns from her that Hakuei is her "King Candidate", appointed by a Magi who lives in the Kou Empire. After bidding farewell to the Kouga Clan, Aladdin joins a caravan looking to reunite with Alibaba.
Alibaba manages to reach the palace grounds, but Abhmad sends one of the three royal guards from the Kou Empire to kill him. After finally succeding to properly equip Amon's sword, Alibaba defeats the first guard, but the second guard and his army of monkeys block his way until Morgiana appears to fight in his place, allowing him to keep pressing forward. As Morgiana fights the second guard, Alibaba runs out of Magoi while fighting the third guard and creates some fire with oil to power up Amon's sword for an instant, using it to bring him down. Meanwhile Sinbad learns about the situation and leaves to the palace too. With all guards defeated, Alibaba reaches the throne room where Abhmad orders his guards to kill him, but Sabhmad intervenes of his favor, insisting that the conversation between his two brothers must not be disturbed.
Before returning to the palace, Sabhmad warns Alibaba that in five days, Abhmad will marry one of the Kou Empire's princesses and in the occasion, his decision to turn the people of Balbadd into slaves will be announced. Some time later while Aladdin still shows no signs of waking up, Alibaba is informed by Sinbad that in order to stop Abhmad's plans and prevent the country to be taken over by the Kou Empire, he must assume the throne of Balbadd. As Alibaba wanders the streets thinking about it, he is approached by Cassim, who is in hing among what remains of the Fog Troupe. Cassim reveals to Alibaba that he already knows about Abhmad's slavery plan and helped by the weapons dealer who supplies their magic tools, he intend to start a rebellion in two days. Alibaba refuses to cooperate with him, and affirms that he will look for a solution which does not involve the death of anyone. After Alibaba is driven away by Cassim, he turns to Sinbad and asks him to teach him how to properly use his djinn. Some time later, Morgiana tries to find Alibaba with no success and realizes that he had left to confront his brother alone. Meanwhile at the palace gates, Alibaba stands before the guards, asking them to let him in.
Alibaba pass through Aladdin, claiming that unfortunatly he can't keep the promise he made to him and invokes the flames of Amon's sword to escape with the rest of the Fog Troupe. Back to his room, Alibaba is kidnapped by Morgiana who brings him before Aladdin so he can explain himself properly. Meanwhile, Sinbad discovers that Balbadd is being pressured by the Kou Empire to adopt their currency. Alibaba reveals to Aladdin and Morgiana the story of how he was raised in the slums along Cassim, the de facto leader of the Fog Troupe and after his mother's death, he was taken in by his father, the King of Balbadd. On his deathbed, the King recognized Alibaba's capacity and asked him to assume Balbadd's throne, but while considering his offer, Alibaba sneaked out of the castle and met Cassim who made use of the tunnels used by Alibaba to infiltrate it with his fellow bandits, much to his regret.
As Yamuraiha teaches Aladdin about the properties of Magic, Sinbad presents Alibaba with a sword he recieved from his late father to replace his broken knife as Amon's metal vessel. Morgiana is also asked to choose an item to be infused with Amon's power to serve as her household vessel, but she decides to have one forged from the same shackles she used during her times of slavery instead. Soon after, a fleet from the Kou Empire arrives bringing the fourth prince Hakuryuu Ren, accompained by Kogyoku, who accuses Sinbad of defiling her body in her sleep during his visit to the Emperor. By Sinbad's request, Yamuraiha makes use of her magic to prove Sinbad's innocence and it is revealed that it was all a scheme of Koubun Ka's to have him marry the princess by force. When Sinbad and Hakuryuu meet in private, the prince expresses his desire to destroy the Kou Empire, which is now under the influence of Al-Thamen.
Alibaba concludes his story, revealing that after Cassim's attack on the palace, his father died and he fled the country in regret. After his encounter with Aladdin, he decided to return to Balbadd to take responsability for his actions, just to find that the slums where he was raised are no more. Cassim revealed to Alibaba that it was destroyed by the government after an epidemic that claimed the life of his sister and asks him to become leader of the Fog Troupe to make a stand against the current king Abhmad, whose disregard for the people has put the country in turmoil. As Sinbad, who is listening the story in the next room takes heed of Alibaba's situation, the hotel is attacked by the Fog Troupe who intends to kill Sinbad and rescue Alibaba, but the King of Sindria and his aides defeat them all. Instead of taking them into custody, Sinbad convinces Alibaba to accompany him to the palace and help bring his brother Abhmad to his senses. In the following day, as Abhmad refuses to listen to Alibaba's request to give aid to his people, Aladdin and Morgiana wait outside the palace amid a huge crowd. When a strange man passes through them, Aladdin has an ominous feeling about him.
Judal is saved from being killed by a princess of the Kou Empire and her aid Ka Koubun, who tends to his wounds. Ugo tries to attack them, but the princess defeats him with the aid of her Djinn Vinea. Aladdin then launches himself in fury against the princess who orders her servants to kill everyone. However, Sinbad intervines and convinces the princess to retreat. As the wounded from the battle are treated, Alibaba and Morgiana find an exausted Aladdin who had almost all of his Magoi depleted in an attempt to bring back Ugo and is in critical condition. Feeling himself useless for not being able to do anything to help and with Cassim still missing, Alibaba is visited by his other brother, the viceroy Sabhmad. Sinbad deduces that it was Sabhmad who was leaking info about the army to the Fog Troupe and he explains that it was all to protect Alibaba, whom he claims is the the only one able to stop Abhmad. He reveals that after contracting a huge debt with the Kou Empire, Abhmad intends to pay for it by selling the people of Balbadd as slaves. Upon hearing that, Morgiana urges Alibaba to make a stand against him.
After a brief contact with the bizarre creatures living inside the Zagan Dungeon, Aladdin, Alibaba, Morgiana and Hakuryuu are greeted by Zagan himself, who holds the child who asked them for help previously as a hostage and declares that to rescue her and the other islanders trapped there, they must succeed in passing his trials. The party clears the challenges and traps Zagan throws at them with certain ease, except for Hakuryuu, whose refusal to accept assistance causes more trouble than help, until he ends up kneeling into tears when Zagan teases him, denouncing how he is dragging down the others. Recognizing the prince as a reflection of his former self, as he believes he could save Cassim should he had asked for his friends' help sooner in Balbadd, Alibaba encourages Hakuryuu and the group resumes their quest with renewed confidence. Meanwhile, Judar appears hovering in mid air over Sindria.
Upon learning Hakuryuu's reasons, Sinbad insists that he should learn more about his country first and asks him to introduce himself to Alibaba and the others. When Alibaba meets Hakuryuu, he hears a voice from himside urging him to hate and attack him, but he collapses instead. Upon being examinated, it is revealed that the snake bite Alibaba suffered in Balbadd has spread into a dark wound onto his body, from which the agent of Al Thamen, who was supposedly destroyed there, emerges. Sharrkan attacks the enemy whose dark blood splashes on Sinbad, cursing him too. Before disappearing, the agent explains that upon cursed, it is only a matter of time before both Alibaba and Sinbad fall into depravity and become overtaken by the Black Rukh. However, there is a dungeon called "Zagan" in an island to the south which is yet to be conquered, and whose Djinn can heal all kind of disease. As Sinbad and his household are forbidden from entering any further dungeon as he already has seven Djinn under his command, he sends Aladdin, Morgiana and Alibaba to conquer Zagan instead. Hakuryuu also offers himself to accompany them on their quest and the four depart to the island, escorted by one of Sinbad's Generals, Pisti. As they approach the dungeon, they are pulled by a strange light and find themselves inside it.
With the help of his friends, Alibaba organizes the reconstruction and establishment of the new democratic government in Balbadd and he is bitten by a strange snake that disappears soon after. However, a huge fleet from the Kou Empire approaches Balbadd and is preparing itself to invade it. Alibaba asks to Sinbad to let him defend his country against the invaders, but to protect him, he knocks him unconscious and sends him with Aladdin and Morgiana to Sindria instead, as he departs to the Kou Empire to negociate with the Emperor on Balbadd's behalf. Several months later, Sinbad returns to Sindria and confirms to Alibaba and Aladdin that Balbadd had lost its sovereignty to the Empire but the rights of its citizens are ensured. In the occasion, Sinbad also tells them that the turmoil in Balbadd was orchestrated by Al-Thamen and asks for their help to stop their plans to spread chaos throughout the world. When informed that a huge monster is attacking, Sinbad sends Yamuraiha and Sharrkan, two of his generals to hunt it down and introduces them to Aladdin and Alibaba, claiming that they can teach them to increase their abilities. Later in the night, a huge party is held to celebrate Sinbad's return where he introduces his other generals to Aladdin and the others and Morgiana asks for Aladdin and Alibaba to keep fighting on their side in gratitude for all they did to her, which they oblige. Meanwhile, a prince sent by the Kou Empire to study in Sindria approaches the country, accompained by Kogyoku, who by some reason, is furious with Sinbad.
Aladdin and his friends return to Sindria and are saluted by the people for conquering Zagan. During the festivities, Hakuryuu and Kougyoku hear that they were summoned back to the Kou Empire. It is also revealed that Dunya is resting at the palace, but refuses to talk to anyone beside Aladdin. By inspecting Dunya's dark metal vessel, Sinbad and his companions discover that it was crafted in Yamuraiha's home country, Magnostadt implying that said nation is somehow involved in Al-Thamen's plans. However, when Sinbad tries to inquire Dunya about it, the vessel fragment inside her body reacts, putting her life in danger. Aladdin manages to save her using Solomon's Wisdom but soon after, they learn that with her condition, she does not have much time left to live. Once reunited with Alibaba and Morgiana, Aladdin informs them that he will soon embark on a new journey by himself.
Now transformed into a Dark Djinn, Kassim takes advantage of Alibaba's reluctance to kill him and breaks his sword. Sinbad tries to weaken Kassim until he is restrained by Judar, who joins the battle and takes control of Kassim. Fueled by all the Black Rukh created by the turmoil in Balbadd, Judar and Kassim overpower Alibaba, but just as they are about to kill him, Aladdin appears to stand in their way. Enveloped by a huge mass of untainted Rukh, Aladdin deflects Judar's attacks and asks for Alibaba's help to save Kassim.
The brainwashed Hakuryuu fights his own friends until Alibaba manages to destroy his metal vessel and he collapses from exaustion. Madaura attempts to escape but she is captured by the Actian military along the rest of the pirates. Back at the port, a commotion is started by the locals who attack the imprisioned Madaura until Hakuryuu stops them not to defend her, but to decapitate her in front of the pirates who swear revenge on him. Questioning him for his actions, Alibaba learns from Hakuryuu that his true objective to to take revenge on his own mother for joining forces with Al-Thamen to have his uncle usurp the throne of the Kou Empire by orchestrating the death of his father and his older brothers. Realizing that the children under Madaura's spell are almost falling into depravity, Aladdin looks for a way to help them, but it is Alibaba who takes custody of the pirates and inspires them to move on with their lives as despite Madaura's death they still have each other to care for. As his friends watch the children depart to Sindria, Hakuryuu decides to leave without bidding farewell to them and when Morgiana appears looking for him, he confesses his feelings for her and asks for her hand in marriage but she refuses. Upon learning of Hakuryuu's sudden departure, Alibaba intends to reason with him fearing that he may end up suffering for killing his own parent just like Cassim did, but Aladdin decides to talk with him by himself. After properly bidding farewell to Hakuryuu, Aladdin returns to his friends' side as they also prepare themselves to follow their separate paths.
Hakuryuu takes the villager girl and Morgiana to the treasure room for their own safety, leaving Aladdin and Alibaba to confront the three enemies, Ithnan, Dunya and her knight Isaac by themselves. Just like Cassim did once, Dunya impales herself with a Dark Metal Vessel and becomes a Dark Djinn to fight Aladdin, while Isaac crosses swords with Alibaba. The young Magi and his friend find themselves on a disadvantage at first, until they change their strategy and gain the upper hand. However, Ithnan has Dunya assume further control of her power, fully equipping her Dark Djinn, while Isaac is revealed to be an inorganic servant of hers capable of regeneration, modeled after the real Isaac who gave his life to protect hers when her country, Musta'sim, from which she was a princess was overthrown by the magicians of Magnostadt. Meanwhile in Sindria, Judar flees after declaring that with the barrier protecting the country now destroyed, an invading force from Al-Thamen is en route there to destroy it. As Hakuryuu returns to assist his friends against the enemy, Sinbad and his forces prepare to defend their country from the impending attack by Al-Thamen.
Mogamett then reveals that after using their magic to gain the favor of most of the population, the magicians led by him incited a revolt that led to the downfall of the Musta'sim royalty and the establishment of Magnostadt. Impressed with Mogamett's speech, the students start opening up to his views except for Aladdin and Titus. Some time later, Mogamett asks Titus to take him to Marga in the 5th district where he allows the girl to live with him at the surface. Aladdin accompanies them as well and realizes that Mogamett does not view the non-magicians as humans anymore and fears that it will eventually lead everyone to ruin. Marga is then examined and Mogamett reveals that while she can't be cured of her condition, her life can be saved, much to Titus' relief. Meanwhile, Aladdin has classes with High Magician Irene Smirnoff, who displays her experiments with Black Rukh and confirms his suspicions that Magnostadt is somehow connected to Al-Thamen. Back at his home, Titus is informed by Sheherazade that his mission is accomplished and is ordered to return home, but he turns to Mogamett for help instead, as just like Marga, he does not have much time left to live.
The forces of Reim led by Mu arrive at Magnostadt and after Mogamett and his forces refuse to surrender, the Empire's soldiers charge forward. However, they are easily repelled by one of the three magical barriers surrounding the city and the magicians' counterattack. Meanwhile, Aladdin roams through the city looking for something that he claims it will bring death to everyone at the city if left unchecked. Back at the battlefield, the Reim forces break through the first barrier using explosives and press forward until the magicians deploy a powerful long range weapon that wipes out hundreds of enemy soldiers at once until Mu and the Fanalis Corps join the battle to protect them by blocking the weapon's shots with massive rocks and confront the Magnostadt forces directly. Perceiving that the magicians' weapon is draining the Magoi of the citizens of the 5th district to the death, Aladdin destroys the cables that power it before flying to the frontlines where Mu defeats Titus and urges him to accompany back home until the young Magi arrives and asks for their cooperation to end the war for everyone's sake.
Instead of accepting Alibaba's solution, Cassim ignites a rebellion claiming that despite being removed from power, the monarchy still must be executed for their crimes against the people. Meanwhile, Aladdin's spirit is brought before Ugo, now reduced to just his head, who reveals to him that Alibaba and the others are in danger by the devices of those who intend to disrupt the natural flow of Rukh and cover the world in darkness. To fight them back Ugo sends Aladdin into a portal for him to be bestowed with the "Wisdom of Solomon" while bidding farewell to him, as according to Ugo, they will never meet again. Back at the palace, Alibaba confronts and defeats Cassim and the rest of the Fog Troupe, but instead of surrendering, Cassim stabs himself with his magic sword, drawing all the troupe's other swords to his body and transforming him into a huge black monster.
The Dark Djinns are temporarily repelled by Kouen's household, but another group of them start attacking the Reim fleet and Sheherazade along Mu and the Fanalis Corps make a stand for the rest of their forces to retreat. Meanwhile, Back in Magnostadt, Titus is sheltered inside his house, clinging to Marga, in despair not only because he has so little time left but is unsure about what he should do for the sake of all the people he befriended. Marga then encourages him to follow his beliefs to the end no matter the cost and the duo leave to meet Mogamett at the Magoi Furnace. Certain that the chancellor does not truly hate the non-magicians as he claims, Titus use the last of the Magoi inside his body to pull Mogamett out of the furnace, dying in the process. However, the Furnace does not stop working and keeps draining Mogamett's Magoi until killing him, becoming a huge mass of energy that opens a portal in the sky and a large, ominous creature start appearing through it. Empress Gyokuen and the members of Al Thamen rejoice with the fact, claiming that the entity in question is their god and it was their intent to summon it all this time. Aladdin recognizes the being as well, and reveals that it must be stopped no matter the cost.
As Alibaba tries to convince Abhmad to step down, Kogyoku Ren, the princess they previously met, appears in an attempt to stop the commotion. She claims that even if Abhmad is removed from power, another king must be chosen to marry her as part of Balbadd's agreement with the Kou Empire and all agreements between both countries, including the slavery treaty, must be aknowledged. Alibaba instead declares that there will be no king at all because Balbadd's monarchy shall be dissolved and adopt a democratic rule. Sinbad joins the discussion bringing some representatives of his confederation, the Alliance of Seven Seas with him and offers himself to discuss Balbadd's inclusion in said alliance with the Kou Emperor in person, prompting Kogyoku to retreat. As Alibaba adresses his decision to the people, the Rukh gathers strangely arround Aladdin and Judal, while Cassim and his men approach the palace.