Farewell, Amanojaku... The Arrival of Ohma is episode 20 and the series finale of the Gakkou No Kaidan anime. It originally aired in Japan on March 25, 2001.
In this climactic episode, Amanojaku's character arc comes to a head as he chooses to save Satsuki and her friends in facing the most powerful spirit they'd yet faced: Ouma the Spirit of Vengeance.
Most every ghost in the series makes a cameo in this episode, reawakened and controlled by Ouma's power.