'Valentine's Day' Episode 16 of the sitcom The Office. Pictured is the cast of the sitcome: (L to R) Angela Kinsey as Angela Martin, Kate Flannery as Meredith Palmer, Steve Carell as Michael Scott, Phyllis Smith as Phyllis Lapin-Vance, and Jenna Fischer as Pam Beesly.

NBC has decided to remove "The Office" from Netflix in 2021 and include the show in the company's new streaming service. The deal will be exclusive for five years.

NBC announced the decision to remove "The Office" in a statement on Tuesday. The hit comedy was the most-watched Netflix show in 2018, according to data analytics firm Jumpshot. The move bolsters the potential appeal of NBC's ad-supported streaming service, which is set to launch in the first quarter of 2020.

A person familiar with the negotiations said Netflix made an offer to keep it, but the offer was rejected. Netflix was willing to pay up to $90 million a year for the rights, but NBC topped that offer and will pay $100 million. ("The Office" was produced by Universal Television, a different division of NBCUniversal, in association with Deedle-Dee Productions and Reveille Productions.) One idea under consideration was to split the rights, with Netflix being the home for ad-free watching, and NBC's service being the ad-supported option.

"'The Office' has become a staple of pop-culture and is a rare gem whose relevance continues to grow at a time when fans have more entertainment choices than ever before," said Bonnie Hammer, Chairman of NBCUniversal Direct-to-Consumer and Digital Enterprises in a release. "We can't wait to welcome the gang from Dunder Mifflin to NBCUniversal's new streaming service."

In a tweet, Netflix added that members can "binge watch the show to their hearts' content ad-free on Netflix until January 2021."

Tweet here

NBC and other media companies have wrestled with what content to license to third-party services such as Netflix and Amazon. NBC has said it won't be particularly aggressive with pulling content from streaming services and turning down potentially lucrative contracts.

Still, the decision may convince more people to sign up for NBC's streaming service, which will be driven by advertising revenue tied to eyeballs. NBC has said the streaming service will be free for subscribers of traditional pay-TV bundles. It will cost about $10 per month for cord cutters, according to people familiar with the matter.

AT&T's WarnerMedia, which is also launching its own streaming service, is planning eventually to add "Friends" and other shows from Netflix to bolster its streaming service, which it hopes will draw at least 70 million subscribers.

Disclosure: NBC is part of NBCUniversal, the parent company of CNBC.