Viewers were almost treated to the nuptials of Castle and Beckett on the Season 6 finale of "Castle." The pair was ready to get hitched until something major brought the wedding to a screeching halt. 

In "For Better or For Worse," Castle (Nathan Fillion) discovers that Beckett (Stana Katic) is technically married. He finds out that 15 years ago, she visited a drive-through chapel with her then-boyfriend Rogan O'Leary (Eddie McClintock) in Las Vegas. She has to find Rogan to get him to sign a dissolution of their marriage. 

Back in New York, the wedding is in jeopardy because the venue was shut down and Beckett's couture wedding gown is ruined. 

Then thanks to Martha and Jim, the wedding is about to happen... until tragedy strikes. 

Beckett, dressed in her wedding gown, is reading to walk down the aisle when she receives a phone call. She runs to the scene to see Castle's car engulfed in flames after being forced off the road by an SUV. 

Series creator Andrew Marlowe spoke to TVLine about the surprising finale, and what will happen next season. 

Marlowe said that after the heavy "Veritas" episode, the writers wanted to add some comedic elements into the finale. 

"We had toyed with this notion of how to complicate the wedding without the conventional, 'The old lover comes back into town' thing, and this was a new version of it, courtesy of Jeaneane Garofalo," Marlowe said. "I think she was the one who discovered, like 20 years later, that she had accidentally gotten married in Vegas not knowing that it was for real. So to be able to do that was exciting, because Beckett has always had the moral high ground in the relationship, because of Castle's divorces."

Marlowe said that Beckett's young mistake makes her more endearing to Castle. 

"In our minds it's not a blow to her character, because she was 19 and thought she was being funny at the time, but it's a huge complication when you have 300 people coming into town and the [wedding] venue is set... "What are we going to do?" She didn't want to be embarrassed, and it set us off on a really fun journey," he explained. 

Marlowe also said that Castle driving off a cliff at the end of the episode is a shocking way to introduce new mythology that will be introduced in Season 7. He admitted that it was an "emotional blow to the audience," but audiences will find out next season what happens to Castle, as well as why it happened. 

Fans are now wondering if Castle's adversary is 3XK, a Bracken thug, or someone related to Jackson Hunt... but Marlowe refused to divulge any details.  

Fans can at least rest easy knowing that Nathan Fillion is signed on for Season 7. 

Marlowe also hinted that viewers will get to see a proper Castle/Beckett wedding in the future. 

What did you think of the Season 6 finale? Leave your thoughts in the comments below.