KANSAS CITY — Rallying following a disappointing performance the year before, the Grain-Based Foods Share Index soared to a record close in 2019. Ending at 27004.09, the index, compiled by Milling & Baking News, rose 25.4% during the year.

The gain was the widest for a single year since 2000, when the index jumped 35.5%, and signaled a resumption of the extended bull market in grain-based foods shares that was interrupted in 2018 with an 11.8% decline. Before 2018, the G.B.F. index had posted gains nine consecutive years.

While shares of food companies and consumer staples in general tend to lag the stock market during the strongest bull markets, the Grain-Based Foods Share Index held its own in 2019 relative to other markets. The 25.4% gain was greater than a 21.8% advance in the Dow Jones average of industrial shares and lagged moderately the 28.8% jump in the S.&P.500 and the 33.1% surge in the Nasdaq Index.

Among the sectors of the S.&P.500, the Grain Based Foods Share Index fell short of all but three. At 25.4%, the grain-based foods advance was less than information technology, up 50.3%; communication services, up 32.7%; financials, up 32.1%; industrials, up 29.3%; real estate, up 29%; consumer discretionary, up 27.9%; consumer staples, up 27.6%; and utilities, up 26.4%. The G.B.F. index bested materials, up 24.6%; health care, up 20.8%; and energy, up 11.8%.

Of the 24 companies included in the index, 19 posted gains for the year and 5 lost ground. A year earlier, only 5 companies in the index posted advances. Of the 19 companies with share price gains in 2019, 17 were at least 10% higher for the year and 11 chalked up advances of more than 20%.

While the top performing stock in the Grain-Based Foods Share Index during the year was a smaller company, The Hain Celestial Group, Inc., the second through fifth largest gains were scored by major consumer packaged foods companies, including the industry’s largest as measured by market capitalization — Mondelez International, Inc.

Several of the top gainers in 2019 were at the bottom among performers in 2018. Despite the heady gains last year, many companies in the index ended with share prices below levels at the end of 2017. Standing out in this regard was Hain Celestial, Lake Success, N.Y. The company’s shares rose 63.7%, ranking first among stocks in the Grain-Based Foods Share Index, partly recovering from the 62.6% plunge in 2018 when the company was the very poorest performer in the index. The wide swings for Hain Celestial stood in contrast to the company’s more modest moves of a 7% gain in 2017 and a 3% decline in 2016. During 2019, Hain Celestial moved to simplify its business structure under Mark L. Schiller, its new chief executive officer. Actions during the year reduced the share of the company’s portfolio that could be characterized as grain-based, including the sale of the company’s WestSoy tofu, tempeh and seiten company and the Tilda rice brand.

Conagra Brands, Inc., Chicago, posted the second widest gain in 2019, up 60.3%. In 2018, Conagra was the third weakest performer, with a drop of 43.3%. The swings followed a 5% drop in 2017 and a 21% gain in 2016. In 2019, successful new product introductions and synergies from the Pinnacle Foods acquisition helped lift profitability.

Following years of struggle, Campbell Soup Co., Camden, N.J., ranked third within the grain-based foods index. A gain of 49.8% in 2019, compared to a drop of 32% in 2018, the sixth worst performance the year before. Campbell Soup shares were down 21% in 2017 and up 15% in 2016. During 2019, the company completed a multi-year effort to divest businesses it did not consider core, following the departure in May 2018 of Denise M. Morrison as chief executive officer. The final transaction in a series was the $2.2 billion sale of its International operations to KKR & Co., Inc. The transaction included the Arnott’s biscuit business.

Mondelez, based in East Hanover, N.J., posted the fourth widest gain in 2019, up 37.6%. Mondelez has been a stronger performer in recent years than this year’s top three, with a decline of 6.5% in 2018 and declines of 4.7% and 2.2% in 2017 and 2016, respectively. The company’s shares ascended fairly steadily during the year, and the company described efforts to sustain momentum of its core brands while also working to make inroads in the better-for-you snacking space.

Ranking fifth in 2019, barely behind Mondelez, was General Mills, Inc., Minneapolis, up 37.5%. Like Hain, Conagra and Campbell Soup, the General Mills jump was a partial recovery from the year before, when General Mills shares were down 34%. The company’s shares were down 5% in 2017 and up 21% in 2016. General Mills shares also rose fairly steadily during the year and benefited from the performance of its pet foods business.

Hostess Brands, Inc., Kansas City, ranked fifth in 2019, with shares posting a 32.9% gain. A year earlier Hostess shares were down 26.1%, the seventh worst performer in the G.B.F. index. Hostess shares ended the year near its 52-week high, weathering a decision during the year by C. Dean Metropoulos to reduce his ownership of Hostess by more than half, selling 12 million shares in a public offering. Also during the year, the company shuffled its non-core business portfolio, selling its in-store bakery business and acquiring Voortman Cookies Ltd. from the private equity company Swander Pace Capital for approximately $320 million.

Sixth in gains during 2019 was J&J Snack Foods, Inc., Pennsauken, N.J., up 27.4%. A year earlier, the company’s share price performance was “middle of the pack” with a 5% decline. The company enjoyed sales growth quarter after quarter, including from products the company said gained momentum during the year. Of churros, Gerald B. Shreiber, president and c.e.o., said on a mid-year earnings call, “A few years ago when we started talking about churros, people would say, ‘What is it?’ ... Now everybody seems to know what a churro is, and more and more customers and accounts are clamoring for the product.”

Bridgford Foods, Anaheim, Calif., was the seventh best performing company in the G.B.F. index in 2019, scoring a share price advance of 24.8%. The gain followed a 57.1% surge in 2018, when the company was the top performer and more modest gains of 13% in 2017 and 32% in 2016. In 2019, Bridgford shares peaked at $38 mid year, up 91% from the Dec. 31 close. After generating wide earnings gains in the first six months of 2019, quarterly profits were lower in the third quarter ended July 12.

Posting the eighth best share price performance in 2019 was PepsiCo, Inc., Purchase, N.Y., up 23.7% from 2018. The previous year, PepsiCo shares declined 8%. During 2019 PepsiCo acquired Pioneer Foods Group Ltd., Johannesburg, South Africa, for approximately $1.7 billion. Pioneer Foods is a manufacturer of cereals, juices and other products that are sold throughout the continent. More generally, the company executed on an early-year commitment by c.e.o. (and later elevated to chairman as well) Ramon L. Laguarta to make the company “faster, stronger and better.” Numerous senior management changes were announced over the course of the year aimed at helping the company reach its more aggressive growth objectives.

Post Holdings, Inc., St. Louis, ranked ninth in 2019 with a 22.4% share price gain, after a 12.5% gain in 2018 that placed the company fourth. In 2017, the company’s shares fell 2%. During the spring, Post Holdings reached an agreement to acquire the private label ready-to-eat cereal business of TreeHouse Foods, Inc., Oak Brook, Ill., but late in the year the Federal Trade Commission said it would object to the transaction, alleging that a “merger between these companies would likely lead to higher prices and reduced quality of the store-brand cereals that consumers enjoy today.”

Rounding out the top 10 list for 2019 was Kellogg Co., Battle Creek, Mich., with a 21.2% advance. A year earlier Kellogg shares fell 16%. During the year, the Ferrero Group acquired Kellogg’s cookie, fruit and fruit-flavored snack, ice cream cone and pie crust businesses in a transaction valued at $1.3 billion.

Six additional companies in the Grain Based Foods Share Index posted double-digit gains in 2019 — Dunkin’ Brands Group, Canton, Mass., up 17.8%; Flowers Foods, Inc., Thomasville, Ga., up 17.7%; Seaboard Corp., Merriam, Kas., up 17.5%; Archer Daniels Midland Co., Chicago, up 13%; and The J.M. Smucker Co., Orrville, Ohio, up 11.4%.

Overall, ingredient companies in the G.B.F. index — ADM; Bunge Ltd., White Plains, N.Y.; Ingredion, Inc., Westchester, Ill.; and MGP Ingredients, Inc., Atchison, Kas., did not keep pace with the G.B.F. index.

Of the five companies in the G.B.F. index sustaining share price declines in 2019, the widest was sustained by B&G Foods, Inc., Parsippany, N.J. The 38% share drop followed an 18% decline in 2018. During the year, Kenneth G. Romanzi took over as president and c.e.o. of B&G Foods, Inc. following the retirement of longtime leader Robert C. Cantwell. During the year, the company felt the effects of the sale of its Pirate Brands business. Later in the year, earnings were pressured by struggles in the company’s Green Giant business.

The Kraft Heinz Co., Pittsburgh, was the second poorest performer in 2019, with a 25.3% share price decline. A year earlier, Kraft Heinz had the second greatest share price decline as well, a drop of 45%. Kraft Heinz shares fell 12% in 2017 and rose 20% in 2016. The 2019 decline for the year occurred on a single day, Feb. 22, after Kraft Heinz said it would write down the value of its Kraft and Oscar Mayer brands by $15.4 billion. The company’s credit rating was downgraded during the year, numerous executives departed and the company’s new c.e.o., Miguel Patricio, promised “straight talk” regarding what Kraft Heinz executives described as “unacceptable” financial results.

MGP Ingredients sustained the third largest share price decline, 15%, in 2019. A year earlier, MGP Ingredients shares were down 26%. The company’s earnings were under pressure over the course of the year. Spring flooding created difficulties for the company, and weak alcohol sales pressured earnings later in the year.

Among other large North American grain-based businesses, performances lagged that of the G.B.F. Index. Shares of Grupo Bimbo S.A.B. de C.V., Mexico City, fell 11.3%; George Weston Ltd., Toronto, was up 14.1%; and Maple Leaf Foods Ltd., Mississauga, Ont., fell 5.5%.

Operating income of the U.S. business of Bimbo was down in the most recent quarter, but the company’s overall net income was higher. During the year, the Mexican peso strengthened slightly against the U.S. dollar.

George Weston financial results in the first three quarters of 2019 lagged the year before. In a November conference call, Galen G. Weston, chairman and c.e.o., said “Weston Foods demonstrated momentum as the business continued to stabilize.”