Meghan Markle as Rachel Zane in “Suits.” (Ian Watson/USA Network)

Among the many things that few could have predicted in the last two years, who would have thought a legal drama on USA Network would become intertwined with British royal history?

Alas, “Suits” will be forever linked to the monarchy, as the show propelled actress Meghan Markle to fame before she met her fiance, Prince Harry. Markle starred for seven seasons as paralegal-turned-lawyer Rachel Zane — and on Wednesday night’s season finale, she said goodbye for good, as she prepares for her new job as a member of the royal family with her May 19 wedding rapidly approaching.

So it was only fitting that Markle’s character bid farewell to the show with a wedding. Rachel tied the knot with her longtime love, Mike Ross (Patrick J. Adams), who started the series pretending to be a lawyer and got himself in all sorts of trouble.

But now, all is well — Mike finally got a real law license last season. In the two-hour season finale, he and Rachel were approached about running a firm in Seattle, one that only works on class-action lawsuits against Fortune 500 companies. At first, they weren’t sure but, ultimately, decided to take the plunge. It was the perfect, drama-free way to write the two characters off the show, as Adams also announced he would depart after Season 7.

So Rachel and Mike moved up their wedding date by six weeks so they could say goodbye to all their friends and family. John Legend’s “All of Me” played in the background over scenes of the ceremony as they said their vows:

Mike: “From the first second I met you, I knew I wanted to be here with you someday.”

Rachel: “I know that I fought it at first, but now, Mike, I can’t imagine living alongside anyone else for the rest of my life.”

Mike: “If I’ve learned one thing, it’s that we never know what the future holds, and that can be a scary thing. But I know that there is nothing that I can’t handle when I have you by my side.”

Rachel: “You are the strongest man I have ever met, and you make me stronger. You’re the husband I’ve always wanted, and I can’t wait to begin our adventure.”

… and that was pretty much it. The eighth season of “Suits” will kick off in July, with new series regular Katherine Heigl playing a fiercely competitive lawyer.

Luckily, the writers had time to plan Rachel’s exit. “Suits” creator Aaron Korsh told Variety last month that once he saw how happy Markle was in her relationship with Prince Harry, he started making contingency plans.

“I guessed that if she married a prince that she wasn’t going to stay on the show. So we decided, in our hearts, to bank on her finding love and kind of having a fairy tale ending in her own life and assuming that good things were going to happen for her,” Korsh said. “Plus, it would be easier to undo a decision to write her off than it would be to, at the last minute, have to make her leave. She would have to get hit by a bus or something, and I didn’t want to do that.”

Meghan Markle as Rachel Zane and Patrick J. Adams as Mike Ross. (Shane Mahood/USA Network/NBCU Photo Bank)

Read more:

The wedding of Prince Harry and Meghan Markle: What to know about the royal nuptials

Here’s how to make your own version of Prince Harry and Meghan Markle’s royal wedding cake

Every little thing to know about Meghan Markle and Prince Harry’s engagement photos