The following post contains major spoilers from tonight’s episode of Chicago P.D.

Though the character’s exit was established as possibility over the last two weeks, the producers and cast of NBC’s Chicago P.D. managed to keep the final fate of officer Sean Roman a secret right up until tonight’s season 3 finale. Thus it still came as quite a surprise for fans of the show when it was confirmed that Roman would be leaving Chicago’s finest and that actor Brian Geraghty was leaving the show.

Roman was gravely wounded in a shooting that occurred two episodes earlier and was offered either a transfer to less active duty, or to quit the force with 3/4 pay. After mulling the decision over, he chose to quit the force and move from the Windy City to San Diego. He asked his partner and recent romantic interest Kim Burgess (Marina Squerciati) to join him but during tonight’s finale, she chose to remain on the force.

Despite the uncertainty of the character within the plot, it turns out Geraghty’s exit from Chicago PD was a fait accompli. As executive producer Matt Olmstead told Deadline’s sister site TV Line, the actor signed on to the show on an unusual year to year basis rather than a more typical seven year contract. “[Geraghty] had a lot of choices, and we courted him and pitched him what the show could be,” said Olmstead. “And we were crossing our fingers that we’d get him. He is the most level-headed, decent human being you’re going to encounter, and he’s upfront. He was like, ‘I don’t know if I can commit to a seven-year contract. This sounds great, but I’ve got to take it year by year,’ which Dick doesn’t do very often. But the deal was made.”

Mid-way through season 3, Geraghty, who is also a producer, told the producers he wanted to focus on other projects, a request the showrunners granted by creating an arc that allowed them to retire the character gracefully.

After the episode aired, fans expressed their surprise and shock at the move, while meanwhile, Geraghty’s co-star Jesse Lee Soffer paid tribute to his former coworker.