This contains SPOILERS for tonight’s episode of Law & Order: SVU: After six years at Law & Order: SVU, Raul Esparza sang his swan song on the NBC procedural tonight.

Esparza first appeared as Assistant District Attorney Rafael Barba on season 14 on a recurring basis. He was upped to series regular in season 15.

Tonight’s episode saw Barba in quite a dilemma after he cut off the life support machine of a brain dead child. He is later tried for murder by attorney Peter Stone (Philip Winchester) — but is found not guilty. Even so, Barba decides to leave his post at the D.A.’s office even though Jack McCoy (Sam Waterston returned for the episode to reprise his role) tries to get him to stay.

Esparza took to Twitter to officially say goodbye to his character. “Thank you. You changed my life. My squad. And you, you always, my Liv, my friend Mariska. I will always treasure my time with all of you.”

As he walks out the SVU door, Winchester, who appeared on Chicago Justice will now be a series regular as the SVU‘s new Assistant District Attorney. Deadline exclusively reported last year that Winchester would appear in the current season of the popular Dick Wolf series.