KFC has reached an agreement to replace PepsiCo with Coca-Cola as its beverage supplier at thousands of U.S. restaurants beginning in January, delivering a major win for Coke in the long-running rivalry between the two soft-drink giants.

The change ends a longstanding relationship between KFC and PepsiCo, which once owned the fried-chicken chain before spinning off its restaurant operations, including KFC, Taco Bell and Pizza Hut, in 1997. PepsiCo will continue supplying beverages to many KFC locations internationally, where the chain operates a significantly larger business.

Pepsi will also remain the beverage supplier for Taco Bell, according to a person familiar with the arrangement. The restaurant chain has particularly close ties to PepsiCo, which developed Mountain Dew Baja Blast for Taco Bell. The specialty drink has generated billions of dollars in sales.

The loss of KFC represents another setback for PepsiCo's North American beverage business, which has faced intensifying competition and shifting consumer preferences. CEO Ramon Laguarta has acknowledged that the company has fallen behind in the soft-drink market, including with its flagship Pepsi brand, as Coca-Cola and Dr Pepper gain ground.

PepsiCo shares declined Thursday after news emerged that KFC was discussing a switch to Coca-Cola. The company has also lost several prominent beverage accounts in recent years, including Marriott hotels and Costco food courts, although it recently secured a supply agreement with Subway.

KFC is a significant player in the U.S. beverage market and remains one of the country's largest restaurant sellers of Pepsi products. Its current lineup includes Pepsi, Mountain Dew, Starry and Aquafina.

The switch also reflects the growing importance of beverages to fast-food chains seeking to increase profits and attract younger customers. Restaurants have increasingly introduced specialty lemonades, flavored refreshers, and customizable drinks as they compete for customers looking for affordable meals and new menu options.

KFC is also trying to reverse years of declining U.S. sales and restaurant closures. Once the nation's leading chicken chain, it has fallen to fifth place in domestic sales, according to market-research firm Technomic. The company has expanded beyond traditional fried-chicken buckets by emphasizing sandwiches, wings and tenders while experimenting with specialty beverages through its Saucy by KFC concept.

The agreement highlights the changing relationship between PepsiCo and Yum Brands, KFC's parent company. While PepsiCo is losing a major U.S. account at KFC, its continued partnership with Taco Bell preserves an important connection to the restaurant industry and one of its most successful specialty beverages.