While the Academy was being attacked by Dweller-in-Darkness. Mordo was trying to find a way to close the portal to the Dark Dimension once and for all. The Avengers eventually beat the Dweller and Kaecilius, but even though Kaecilius was incarcerated in one of the Academy's prison cells, he was still able to cause enough of a disruption so the true master of the Dark Dimension could cross into their dimension.
When Dormammu was about to be defeated by the heroes, Mordo who had been dealing with his jealousy of Doctor Strange due to him being their master prize pupil, offered Dormammu his help. Mordo proposed that he would become his ally and help him conquer this dimension if he gave him immortality, but Dormammu refused to ally himself with him.