The series finale of "How I Met Your Mother" was very polarizing -- some liked it, others hated it.

One of the show's stars, Neil Patrick Harris, loved it.

The Broadway star, 40, stopped by "The Late Show" and talked about the finale after nine seasons on the air.

"It wasn’t necessarily the happy ending that people were expecting,” he said of Ted getting back together with Robin years after his wife dies. "But Carter [Bays] and Craig [Thomas], who were once writers on your show and the executive producers and creators, knew this ending years ago and had played towards that. And I was a big proponent of it and a big fan of it.”

He continued, adding in a fun jab about Barney and Robin getting divorced, saying: "Sometimes, people’s growth doesn’t really mean that they grow up. There are certain people who you want them to get into a solid relationship and really settle down and learn from things. And you want Barney to be the guy you can bring your mom home to — but Barney’s the guy who wants to bang your mom."

Fans might have wanted Ted to be with "the mother" -- but Harris said, "At the end of the day, it’s not always meant to be that way."