As Sasuke runs out of chakra, Orochimaru attempts to take over his body using the Eight Branches Technique . Itachi uses the Sword of Totsuka to seal Orochimaru away forever, finally freeing Sasuke from the Cursed Seal.

Here’s a helpful write-up for anyone searching for when Itachi Uchiha dies in Naruto Shippuden :

Itachi’s death is revisited and given deeper emotional impact in ( Naruto Shippuden ) when the truth about the Uchiha Clan Massacre is fully revealed. Additionally, Itachi is later reanimated during the Fourth Great Ninja War (first appears in Episode 321) and finally meets his second end in Episode 358 ( "The End of the War" or similar titles depending on the arc), where his soul returns to the afterlife.

: Tobi reveals the "truth" about Itachi to Sasuke.

To get the full context of Itachi’s life and sacrifice, these are the essential episodes: