Terra first made cameo appearances in the secret endings of Kingdom Hearts II and Kingdom Hearts II Final Mix which depicted events from Birth by Sleep. Additionally, the Lingering Sentiment, an armor containing Terra's thoughts, appears in Kingdom Hearts II: Final Mix as an optional boss in the world Keyblade Graveyard. The Lingering Sentiment fights the game's protagonist Sora upon sensing Xehanort's presence and acknowledging Sora as a Keyblade Master afterward.
In the prequel Kingdom Hearts Birth by Sleep, Terra is a trainee from Master Eraqus alongside Aqua and Ventus, developing a strong sibling-like bond with both of them. One day, Terra participates with Aqua in an exam to become Keyblade Masters. Terra fails to pass the test as Eraqus detects darkness in his heart, which he does not approve. Eraqus later informs Terra and Aqua about the appearance of creatures known as the Unversed and the disappearance of Master Xehanort. He orders both of them to eliminate the Unversed and find Xehanort. During his search for the missing Xehanort, he interacts with several Disney characters for information on his whereabouts as he faces his inner darknesss. When finding Xehanort, Terra is requested by him to kill Vanitas, a figure made from Ventus' darkness and source of all the Unversed. Xehanort later makes Terra return to the Land of Departure to stop Eraqus from killing Ventus. Unwilling to let Ventus die, Terra rescues him and confronts Eraqus. As the battle finishes, both Terra and Eraqus apologize to each other for their actions, but Eraqus is then killed by Xehanort. Realizing Xehanort's true nature, Terra goes to the Keyblade Graveyard where he reunites with Ventus and Aqua and prepare to face Xehanort. There, Ventus tells Aqua and him that Xehanort plans to use him and Vanitas to create the legendary χ-blade to help him in his plans which caused Eraqus to try to kill him. The three are then confronted by Xehanort and Vanitas and proceed to fight. When Ventus and Aqua are wounded in battle, Terra attacks Xehanort alone and unleashes the darkness in his heart, allowing Xehanort to take over his body. However, Terra's mind persists in his discarded armor, becoming the Lingering Sentiment, and continues to fight Xehanort, knocking him out. The Lingering Sentiment remains in the Keyblade Graveyard, while Terra's heart has an internal struggle with Xehanort's in his original body when Xehanort battles Aqua. This results in Xehanort stabbing himself to stop Terra, but Terra's presence remains within Xehanort, swearing to stop him. Although Terra's fate remains unknown, he appears in the game's last scenes alongside Ventus uttering Sora's name with renewed hope.