A vigilante group called the Phantom Thieves of Hearts, led by the protagonist, is cornered inside a casino by police during a heist. The protagonist attempts to escape, but he is captured, arrested, and taken to an interrogation room. There, public prosecutor Sae Nijima confronts him and demands an account of the events that led up to that point. The protagonist begins to tell his story.
After the protagonist defends a woman from being abused by powerful politician Masayoshi Shido, Shido uses his connections to have the protagonist charged with assault and put on probation, resulting in expulsion from his school. The protagonist is sent to Tokyo to stay with family friend Sojiro Sakura and attend Shujin Academy during his year-long probation. After his arrival, he is drawn into the Velvet Room, where Igor warns him that he must "rehabilitate" to avoid forthcoming ruin, and grants him access to a supernatural mobile app that leads the protagonist into the Metaverse and the Palace of the school's abusive volleyball coach Kamoshida. The protagonist meets Morgana, who convinces him to change wicked people's hearts by stealing their "treasure"—the emotional root of their behavior—from the Palaces ruled by their Shadow selves. After successfully reforming Kamoshida and having a second brief encounter with Shido, the protagonist and Morgana form the Phantom Thieves, stealing corruption from the hearts of adults in an attempt to reform the city.
The founding members are the protagonist, Morgana, Ryuji and Ann. On subsequent heists, they are joined by Yusuke, Makoto, Futaba and Haru. As their numbers and successes grow, they attract the attention of public and police including Sae and detective prodigy Goro Akechi. They learn that a secret conspiracy is manipulating events behind the scenes, and is directly connected to some of the Phantom Thieves' reasons for joining. Haru's father tries to reveal this group's leader after he is reformed, but an assassin kills him. In their pursuit of the conspiracy, the group is joined by Akechi, and goes on a mission into Sae's Palace when she discovers their identities. Following her defeat, the group is forced to split up when they are confronted by police, and the protagonist is arrested, leading to the interrogation in the frame story. Akechi is subsequently revealed to be a traitor working for the conspiracy. The protagonist convinces Sae of his righteousness and hatches a scheme to use the reality within Sae's still-intact Palace to save himself when Akechi attempts to kill him in a staged suicide. Failure to complete any Palace prior to this point results in Akechi killing the protagonist.
Escaping into hiding with Sae's help, the protagonist convenes with his friends, Sae, and Sojiro; they determine that the conspiracy's leader is Shido, who has been using Akechi's ability to infiltrate the Metaverse to remove obstacles to becoming Prime Minister and imposing his reforms on Japan. The group infiltrates Shido's Palace, and there they face Akechi, revealed to be Shido's illegitimate son bent on revenge towards Shido for his years of neglect. Once defeated, Akechi sacrifices himself to allow the Phantom Thieves to reach Shido. Shido is defeated, and in the real world confesses to all his actions. The game then skips forward to just before Christmas; the general public has turned on the Phantom Thieves, and Sae's efforts to prosecute Shido are failing. The Phantom Thieves make a final heist to seal the Treasure of the Mementos, the people's Palace at the Metaverse's core. Inside they find the imprisoned Shadows of their targets and other Tokyo residents, who have chosen to give up making their own decisions. The Phantom Thieves are then ejected from Mementos by the Treasure—a giant Holy Grail—and subsequently vanish after witnessing the Metaverse merging with reality.
Waking in the Velvet Room, the protagonist confronts Igor, Caroline and Justine. He persuades Caroline and Justine to merge, revealing their true form: Lavenza. Lavenza reveals "Igor" to be an imposter who is one and the same as the Holy Grail. His true name is Yaldabaoth and he was generated by humanity's wish for control and guidance through life. He granted the protagonist and Akechi their abilities to see whether the world would be preserved or be destroyed through their actions, all while steering events in its favor. The true Igor, who believed in humanity and was imprisoned by Yaldabaoth, created Morgana to help the protagonist. Yaldabaoth offers to restore the world if the protagonist continues in his role: if he accepts, the protagonist is returned to the world to continue his activities at the cost of humanity's freedom. By refusing the offer, the protagonist reunites with the other Phantom Thieves and they face Yaldabaoth. Their allies rally the popular support of the people, severing Yaldabaoth's control of humanity and allowing the protagonist to awaken Satanael—a Persona manifested from humanity's wish for freedom—to destroy Yaldabaoth and the Metaverse. While the protagonist must turn himself in so Shido can be prosecuted, his friends and associates successfully help secure evidence of the protagonist's innocence in the assault charge, leading to his conviction being overturned. The game ends with the protagonist beginning his journey home alongside his friends.
Information Source: Wikipedia