It’s official: the battle among pay TV movie providers is going to be a long one.

Time Warner’s HBO said yesterday it has renewed its movie-distribution deal with Comcast’s Universal Pictures until 2022 — a move partly designed to keep hard-charging Netflix CEO Reed Hastings at bay.

Terms of the deal weren’t disclosed, but it’s likely worth upwards of $200 million a year, according to reports.

The move by Jeff Bewkes’ HBO is the latest salvo in the battle among Netflix, HBO, Starz and other pay-TV movie providers for relevance and supremacy.

Last month, Netflix startled Hollywood with an agreement to start streaming Walt Disney movies beginning in 2016, a deal analysts estimated to be worth $350 million. Insiders say Hastings, likewise, is poised to bid for movies from Sony Pictures — a move that could snatch away the most important studio partner of smaller streaming rival Starz, owned by Liberty Media.

Nevertheless, HBO’s deal with Universal, whose recent hits include “Ted” and “Les Misérables,” will help the pay-TV giant maintain its grip over about half of major studio releases for years to come.

Netflix’s movie-streaming service, which charges as little as $8 a month for access to more than 10,000 movie and TV show titles, is seen as a threat that could force pay-TV networks and cable providers to lower their monthly rates.

That’s because cost-conscious couch potatoes have been ditching their set-top boxes for subscriptions from Netflix and other similar, fast-growing streaming services, including Amazon.

In addition to the Universal deal, which it has held since 2003, HBO has a long-term movie deal with sister studio Warner Bros. that is set to expire next year.

In August, HBO renewed a long-term agreement with 20th Century Fox, which is owned by News Corp., also a parent of The Post. HBO also has a smaller deal with Summit, now part of Lionsgate.

HBO has grabbed headlines mostly for its original programming, which recently has included hits like “Game of Thrones” and “Girls.” Nevertheless, sources say theatrical releases account for 84 percent of viewing on HBO, and securing the latest movies is crucial.

Starz, which Liberty Media plans to spin off into a public company, passed on renewing its deal with Disney, which picked up a bigger paycheck from Netflix. Starz is now left with little more than its now-vulnerable deal with Sony.

Earlier, Netflix signed deals for new films with smaller studios, including Relativity Media, The Weinstein company and DreamWorks Animation.

Netflix has talked about bidding on a deal with Warner Bros., but sources said it seemed unlikely Warner would help build Netflix.