[Warning: This article contains major spoilers about the series finale of The Mentalist. Read at your own risk!]

Well, it finally happened. Patrick Jane (Simon Baker) put a ring on it.

The Mentalist ended its seven-season run Wednesday night with a series finale that saw Jane and Teresa Lisbon (Robin Tunney) tying the knot, giving fans a happy twist of an ending. How did it all come together?

Not without a few harrowing moments, of course. In the first of two hours, Jane was kidnapped by a serial killer named Keller (a.k.a. Lazarus) who was also a "blood harvester" (don't ask), and who accused Jane of lying about his mental capabilities. After Jane snooped around the room where he was being held captive, he discovered a literal (almost) skeleton in Lazarus' closet: Lazarus' father's corpse. Jane used the knowledge to convince Lazarus that he truly did have "powers," and finally escaped after staging a fiery explosion in the house. But, twist! His abductor escaped, too.

The best and worst series finales of all time

Later, while Jane and Lisbon were enjoying a romantic afternoon at their cabin, Lisbon noticed that Jane was no longer wearing his wedding ring. "I'm not married anymore," he said, before using the ring to propose to Lisbon and explaining to her that he wanted it to represent his past as well as his future. Aww!

Lisbon being Lisbon, she wanted a low-key justice-of-the-peace ceremony, much to the disappointment of her brothers. But after she caved and invited them to attend, the guest list snowballed until Jane and Lisbon had a full-fledged party on their hands. Abbott (Rockmond Dunbar) offered to host, Cho (Tim Kang) helped Lisbon pick out her dress (!!), and we were off to the races — or the Abbotts', as it were.

Of course, Lazarus was still on the loose — and looking to wrap up his unfinished business with Jane by crashing the wedding, apparently. Who else was coming to Austin for the festivities? Lisbon's whole family, with approximately 47 kids in tow, as well as Rigsby (Owain Yeoman) and Van Pelt (Amanda Righetti)! It was all a bit overwhelming for Lisbon, who broke down into tears and said she just wanted to elope. Jane thought eloping was a great idea — especially since it would give them a way to dodge Keller.

Just as Lisbon and Jane were about to enjoy what looked to be a quiet wedding at the cabin, Keller — who'd hidden in the trunk of the officiant's car — showed up. But they were expecting him, and a team of FBI agents (plus Lisbon, looking totally badass as she wielded a gun in her wedding dress) descended upon him. On with the show!

Get scoop on The Mentalist's series finale

After a quick exchange of vows, the party began — with dancing and selfies aplenty, set to the strains of Earth, Wind & Fire's "September." And, we were treated to a great reveal in the final moments, with Lisbon telling Jane she's pregnant!

TVGuide.com chatted with Tunney and Mentalist creator Bruno Heller to get a breakdown of the series finale. Read the full interview below to find out how the writers settled on the ending, and what Tunney's (promptly rejected) idea was for the final scene.

TVGuide.com: When was the decision made to have Jane and Lisbon get married in the finale?
Bruno Heller:
The romance between Jane and Lisbon kind of developed organically and naturally without anyone really thinking about it, to some degree. The beauty of being on the air for seven years is that the characters, in a very real way, become real. The love and family feeling on the set simply had to be transferred onto the screen. ...If we got the chance to end the show exactly as we wanted to do as opposed to hearing after the fact that we don't get another season, I always wanted to end with a very sincere and sunny, happy ending. Because that's what stories are for.

Robin Tunney: It never happens in life. It's got to happen on TV. (Laughs) ... It does give you an ending and it does give you an idea of what these people's lives are going to be after. An ambiguous ending, after this much commitment, [would be] hard. We owed it to [fans] to let them have some sort of security in the future of what was going to happen to these people.

It was great to see Rigsby and Van Pelt again.
It was so perfect! There was no acting involved. You're so happy to see the people [again]. It was great.

VIDEO: Stars show us their bizarre talents

Bruno, now that you're also acting as the showrunner on Gotham, how much of a hand did you have in the finale?
This season has been very much more in the hands of Tom Szentgyorgyi, who's been there pretty much almost from the start. He took over the writers' room for this season, and a lot of the credit for the new sort of sunny tone that we were able to put into the show this season is owed to him and the other writers. But, for the finale, it was very much a collaborative effort between me and Tom and Jordan Harper.

Robin, you said you had an idea for an ending that you pitched to the writing team?
It was the worst idea ever. Clearly it's why I'm not a writer. Fans would have been furious. I just thought he should ask and then it should just cut and you don't know. Leave it sort of ambiguous. It would have been the worst idea ever. (Laughs) These poor people have followed the show for this long. Give them an ending! I'm mean-spirited, I guess.

Heller: That's nothing. Baker was saying, hey, how about we machine-gun them all as they're standing at the altar? It was like, 'Uh, we'll think about that one.' He was joking, of course - but only to a degree.

Robin, you've said previously that Teresa Lisbon is so defined by her work. What do you think has changed in her that made her accept Jane's proposal?
So much of her life has been dictated by the ambition of her job and sort of living in a man's world. The idea of giving that all up for love feels scary. ... It's been an ongoing thing, and [Jane] really does want to go and have this other life together. ... [Now] she has something else, like a reason to go home. I think that's really amazing, and through that, she became more of a well-rounded human being. It was fun as an actor to see that there was a different side to her.

What did you think of The Mentalist's series finale? Sound off in the comments!

(Full disclosure: TVGuide.com is owned by CBS.)