NEW YORK/BERLIN (Reuters) - McDonald's Corp MCD.N ended its 41-year-old sponsorship of the Olympic Games three years early, the International Olympic Committee said on Friday, reflecting the U.S. fast-food giant's focus on its core business as well as rising Olympics sponsorship costs and declining TV ratings.

McDonald’s deal would have run through the Tokyo Olympics in 2020, and bowing out will likely to save it hundreds of million of dollars if it had continued into the next four-year Olympics cycle and beyond.

McDonald’s has been trying to hold down costs as it invests in improving food quality, restaurant service and online ordering to woo back U.S. diners. Intense competition has gnawed away at sales.

“We are reconsidering all aspects of our business and have made this decision in cooperation with the IOC to focus on different priorities,” said McDonald’s Global Chief Marketing Officer Silvia Lagnado.

The company, first involved with the games in 1968 and a sponsor since 1976, was the Olympics’ food retail sponsor. Despite pulling out with immediate effect, McDonald’s will continue at next year’s Pyeongchang winter Olympics as a domestic sponsor.

The company’s move may also reflect a rising view among consumer brands that exclusive Olympics sponsorship deals do not offer the marketing impact they once did. Some companies find it is much cheaper to work directly with athletes or specific countries than the IOC.

Moreover, in a trend that began after the Beijing games in 2008, shrinking television audiences for the games could be diminishing the value of sponsors' ads. With the Rio de Janeiro games in 2016, many viewers turned to social media alternatives like Twitter Inc TWTR.N and Facebook Inc FB.O.

In the United States, Comcast Corp's CMCSA.O NBCUniversal

said it had attracted 8.6 percent fewer eyeballs for Rio than it

FILE PHOTO - Athletes line up at a McDonald's inside the Olympic village in Rio de Janeiro, Brazil on August 1, 2016. REUTERS/Kai Pfaffenbach/File Photo

did for London in 2012.

The fast food chain has been part of the IOC’s top sponsors program that contributes more than $1 billion in each four-year cycle for the games.

While terms of Olympic sponsorship are not disclosed, a source who negotiated previous IOC sponsorship deals said that top global sponsors like McDonald’s spend about $25 million a year or about $100 million for a four-year period that includes a summer and winter games.

Reuters previously reported that the IOC had wanted to roughly double fees to $200 million per four year period starting in 2021.

While it is unusual for an Olympic sponsor to leave early, sponsors change regularly within the IOC's top program. The most recent addition was China's Alibaba Group Holding Ltd BABA.N, which signed a deal in January for a partnership through 2028.

The next three Olympics take place in Asia, and this could turn off U.S. sponsors trying to reach a U.S. audience. The U.S. Olympic Committee also has lost recent sponsors such as AT&T T.N and Citigroup C.N ahead of the 2018 winter games in South Korea.

The IOC said it was not planning a direct replacement for McDonald's, but it is expected to announce a new global deal with Intel Corp INTC.O next week, according a source familiar with the matter.

Intel did not immediately respond to a request for comment.

“Companies with a deep focus on technology are barging in while others migrate out,” said Peter Land, who works with Olympics and Paralympics sponsors for communications firm Finsbury.

The IOC has faced criticism from public health campaigners for allowing sponsors such as Coca-Cola KO.N and McDonald's to use the games to market their products, which are perceived to be unhealthy.

John Lewicki, who oversees global Olympic sponsorship deals for McDonald’s, said last year the company would reevaluate its Olympic relationship after changes to a rule that ended a marketing blackout for companies that sponsor athletes rather than the event itself.

Shares of McDonald’s rose $1.06, or about 0.7 percent on Friday.