How I Met Your Mother
Cristin Milioti as the motherCBS

Actress Cristin Milioti, best known for playing the mother in How I Met Your Mother's last season, has spoken out about the show's final episode.

CBS's New York-set drama ended with an opinion-dividing episode which saw the mother die and her husband Ted (Josh Radnor) end up on the doorstep of on-and-off love Robin (Cobie Smulders) hoping to win her over again.

We called it one of the "worst TV endings ever" in our review, but others, including Milioti, were far more forgiving.

How I Met Your Mother
Left to right: Neil Patrick Harris as Barney, Cobie Smulders as Robin, Josh Radnor as Ted, Jason Segel as Marshall and Alyson Hannigan as LilyCBS

On finding out that her character dies, the actress told Vulture: "It was super sad. I just burst into tears as soon as they told me... The way that [show co-creator Craig Thomas] and Josh explained it to me was, 'Well, Ted has two loves, and basically what we're trying to say is that life comes at you in ways you can never expect.'

"Once they put it that way, I understood it more. I was like, that's really involved and awesome.

"At first I was like, 'But wait, no, he finally found her.' I had just caught up on all the seasons, so I said, 'But this dude's been looking for the mother of his kids forever.' They were like, 'No, they had a wonderful marriage together and they had these two beautiful children and it's still super sad, but we want it to be lifelike.'

"And that's how this show's always been. Marshall [Jason Segel] lost his dad. Robin finding out she can't have kids. They explained it was their plan from the beginning, and then I was along for it, along for the ride."

She also spoke of a fan-made ending which circulated online following the finale, which did away with the mother's death and ended where many people thought it should, with Ted meeting her for the first time.

"I was super touched, I'm not gonna lie," she said. "Because first of all, someone cares about this show so much, they took time out of their day. And that he felt the need to save this character. That was hugely flattering."

The fan-made ending was taken down by CBS because an officially sanctioned alternate ending was already being made, which is on the show's season nine DVD set.