Primal Fear
(1996)

Defense attorney Martin Vail (Richard Gere) wants desperately to prove to the judge and jury that his client Aaron Stampler (Edward Norton) has a split personality. He wants to show that Aaron himself is a gentle, innocent country boy, and that Aaron’s violent alter ego “Roy” was the murderer. Vail puts Aaron on the witness stand and baits him until he transforms into Roy. Roy angrily attacks the prosecutor. When the judge sees Roy’s violent personality, she orders that Aaron/Roy be sent to a mental hospital for treatment instead of to prison.

Vail visits Aaron in his holding cell, where Aaron reveals that he doesn’t have a split personality at all. The gentle country boy “Aaron” never existed. That was a false front that the devious, violent Roy was putting on to win sympathy from the jury. Roy tricked Vail and the entire courtroom. Now, instead of going to prison for murder, Roy will only go to a comfortable hospital, and will be released as soon as he can fool the doctors into thinking he’s been cured.

Vail leaves the jail cell, devastated, as Roy laughs at him.
  

Thanks John L!