A sponsor since 1976 and part of the IOC's top sponsors programme, McDonald's had a contract running to the 2020 Tokyo summer Olympics.
The IOC has faced criticism from public health campaigners for allowing sponsors such as Coca-Cola and McDonald's to use the Games as an opportunity to market their products, which contrast with the image of healthy living that the event seeks to promote.
"As part of our global growth plan, we are reconsidering all aspects of our business and have made this decision in cooperation with the IOC to focus on different priorities," McDonald's Global Chief Marketing Officer Silvia Lagnado said.
McDonald's has been tightening costs as it invests in improving its food quality, restaurant service and online ordering to woo back diners in the United States, where intense competition has gnawed away at sales.
The company, first involved with the Games in 1968, was its food retail sponsor. Despite pulling out with immediate effect, McDonald's will continue at next year's Pyeongchang winter Olympics as sponsors with domestic marketing rights.
Financial terms of the separation have not been disclosed, and the IOC said it was not planning a direct replacement for McDonald's.