USA has confirmed that actress Meghan Markle will be leaving TV show, Suits, following her engagement to Prince Harry.

She “will depart from USA’s legal drama at the end of Season 7, which returns to the network in early 2018,” the network said in an official statement.

In Suits, Markle played Rachel Zane, a paralegal-turned-lawyer at Pearson-Specter-Litt.

Show creator Aaron Korsh revealed that Markle had already been written out of the show a year ago, when her relationship with the Prince became public.

ALSO: Prince Harry Confirms He’s Dating ‘Suits’ Star Meghan Markle

In the interview, Korsh said: “I knew from a year ago that this relationship was burgeoning.

“And I had a decision to make because I didn’t want to intrude and ask her, ‘hey what’s going on and what are you going to do?’.

“So collectively with the writers, we decided to take a gamble that these two people were in love and it was going to work out.”

Korsh added: “What we decided to do (was to) say, ‘look, I would rather have good things happen to Meghan in her life’ – which would likely mean her leaving the show.

“So let’s plan on that and it’s much easier to undo that, if it came to it, than to just plan on her staying forever and then finding out she’s going to go.

“And the only way to write a character out like that would be if they got hit by a bus or something.”

Patrick J. Adams, who plays Mike in the series, is also rumored to be leaving, but it hasn’t been announced yet.