PepsiCo CEO Indra Nooyi will step down after 12 years leading the food and beverage giant, ending a tenure marked by efforts to adapt to changing consumer tastes and fending off pressure from activist investors.

President Ramon Laguarta, 54, will succeed the 62-year-old Nooyi effective Oct. 3, becoming Pepsi's sixth CEO. Nooyi will remain as chairman until early 2019.

"Growing up in India, I never imagined I'd have the opportunity to lead such an extraordinary company," Nooyi said in a statement. "PepsiCo today is in a strong position for continued growth with its brightest days still ahead."

Pepsi stock gained cumulatively 79 percent since she assumed the CEO role in October 2006, according to FactSet. That's less than both the S&P 500, which gained 112 percent, and Coca-Cola, which gained 108 percent. It grew net revenue from $35 billion in 2006 to $63.5 billion in 2017.

It also faced challenges from upstart brands that continue to threaten its market share, including once-dominant drinks like Gatorade. Pepsi's North American beverage business has been more challenged than its stalwart snacking business, continuing to provoke questions about whether the giant would consider splitting the two.

Activist investor Nelson Peltz had taken a stake in the Pepsi and pushed for a split of the two businesses before backing off and exiting the company in 2016 after a multi-year battle.

Under Nooyi, Pepsi steadfastly kept the two businesses together, arguing in favor of the combined leverage it gives the company over retailers. It sought to revive its North American drink business by throwing more support behind its core brands. It said it erred in giving up prime shelf space in favor of supporting its younger drinks and lagging behind Coca-Cola in advertising spend.

Efforts to reinvigorate its largest brands include its Pepsi Generation advertising campaign, the re-release of Mountain Dew Baja Blast and the launch of calorie-free Gatorade Zero.

It has also continued to support its snack business, announcing in May the acquisition of baked fruit and vegetable company Bare Foods. The deal may also serve as a building base for the broader business of plant-based snacks.

Nooyi is the second female CEO of a food and beverage company to leave the post since May, following Campbell Soup's Denise Morrison. She is also the latest in a growing list of departures of chief executives across the food and beverage industry, as it faces the unprecedented challenge of remaking decades-old companies under the glare of the public eye.

Laguarta, a 22-year veteran of the company, has been president since September, overseeing global operations, corporate strategy, public policy and government affairs. Prior to that, Laguarta served in leadership positions in the European and sub-Saharan Africa divisions.

The international markets have been a strong point for Pepsi amid slowing growth and tougher retailers in countries like the U.S. Pepsi this quarter reported 7 percent organic revenue growth in Europe Sub-Saharan Africa and 6 percent growth in Asia, Middle East & North Africa.

With Nooyi's departure, the rest of PepsiCo's senior leadership team will remain unchanged, the company said.

PepsiCo's premarket stock price rose slightly after the announcement.