As Itachi was able to stop Kabuto's ET, the reanimated souls got released.
But what happened to Nagato?
Since he was pierced with Itachi's Totsuka Blade, will his soul be released? Or will he be trapped in the sake jar?
I haven't found a proper answer, it seems to me that this one is unanswered, yet Nagato stated this before the sealing was over:
Bidding them farewell as the sword seals him, Nagato remarked that he was going to rejoin his teacher in the afterlife. With Nagato sealed, Kabuto cursed the fact that Nagato's mobility was hampered.
So it appears to me that Nagato knew that he'll be released and he would meet Jiraiya in the afterlife. Btw, don't forget that every sealed reanimation body was released (e.g all the Kages), so we could assume that along with them, Nagato was freed from the jutsu, too.
Nagato was released from Itachi's seal when Itachi undid the Edo-Tensei, Nagato knew he would rejoin Jiraiya, because he had no doubt that Itachi would be able to stop kabuto and undo the Jutsu, when Itachi sealed him, it was because he was the link to the Totsuka blade, when Itachi released (Killed) himself by undo-ing the Jutsu, there was no more link, thus freeing Nagato to the afterlife with Jiraiya again.