When in the upper cistern, decline to free the girl and say you will gather the others (I had to speak to her twice for this to appear).
Then kill her and run for the portal.
Tell the guy in front of you to do something for you and tell him to gather the others.
Then simply go back the captive and free her, letting the rest play out.
I tried to make this as spoiler free as possible, avoiding character names and such.