It took 38 episodes of The Mindy Project for Mindy Lahiri (Mindy Kaling) and Danny Castellano (Chris Messina) to acknowledge — and act on — their feelings for each other. The result was a sweet and sexy payoff to a couple that fans had been 'shipping for over two years.

But, a mere three episodes later it all came to a sudden end, as Danny shockingly pulled the plug on their relationship, out of fear that his less-than-stellar track record with women would cause irreparable damage to his friendship with Mindy. While it caught many fans off-guard, according to Kaling, Messina, and co-star and executive producer Ike Barinholtz — who co-wrote the April 8 big breakup episode, "Be Cool" — this has been the plan since day one.

"It was a lot of work to get them together, but we always knew that there had to be a complication once we got them together," Barinholtz told BuzzFeed. "That's why it was so important to us that the first act really give the fans what they'd been waiting for: Mindy and Danny being together and kissing in the office, because we knew there would be this big flag on the play in the next act."

While the writers envisioned this trajectory for some time, it came as a bit of a shock to Messina that, after two seasons of buildup, his character ended the relationship before it truly began. "I was very surprised and then I was worried that people would feel Danny was being really mean to Mindy because of how he ended things," Messina said. "I saw it as a very human reaction. It's scary when you have really strong feelings for somebody, especially given everything he went through with a divorce. I think he felt it was easier to put on the brakes then to follow through into the unknown. Obviously he loves her, so he tried to do this in the kindest way possible. But, as we all know, there's no right way to break up with someone."

With a little time to digest, Messina came to understand why this was the best decision for the show's longevity. "It would be a totally different show if Danny and Mindy were together," Messina said. "That would be a cool show I'd like to see, but I think it's more realistic to have them try this relationship on for a second and try to have things go back to the way they were before."

Although, Kaling said, Danny is in for a rude awakening over the next six episodes, as he thinks it'll be easy for them to fall back into their old routine. "Danny's smart enough to know there will be a rough patch after their breakup, but he truly thinks things will go back to the way they were pretty soon because he didn't let it get too serious," Kaling told BuzzFeed on the set of The Mindy Project. "But the sad surprise — and we touch upon it in an upcoming episode — is that it can't go back to the way he wants it to be."

Danny's desired reset remains elusive, thanks to a realization that promises to forever change Mindy. "Danny was the initiator and the ender of the relationship, and that is something Mindy picks up on and does not like," Kaling revealed. "This is a very proactive character and that's a very frustrating thing for her, so moving forward, Danny pays a price for pulling her out of this great relationship with Cliff [Glenn Howerton] only to, one month later, break up with her. That's going to have long-term effects."