The story reaches back to rookie attorney Mia Fey's very first trial, where she and her partner Diego Armando defend death-row inmate Terry Fawles against the charge of murdering policewoman Valerie Hawthorne. Squaring off against a likewise green prosecutor named Miles Edgeworth, Mia's persistence uncovers the truth: years earlier, Terry, Valerie, and Valerie's younger sister Dahlia staged a fake kidnapping to steal a priceless jewel, only for the treacherous Dahlia to fake her own death and let Terry take the fall for murder. When Terry, hoping to learn the truth, instead swallows poison Dahlia gave him long ago, he dies in court — forcing a mistrial and setting Dahlia free.
Dahlia goes on to poison Armando, leaving him comatose, and insinuates herself into the life of university student Phoenix Wright, posing as his girlfriend to bury the evidence. Months later, when Phoenix is charged with the murder of his classmate Doug Swallow, Mia takes his case and exposes Dahlia as the true killer — and the woman behind Armando's poisoning, who had planned to kill Phoenix too. Dahlia is arrested, convicted, and sentenced to death, and Phoenix, already drawn toward the law, asks Mia to become his mentor.