NEW YORK: In 2016, the Standard & Poor’s 500 index jumped 9.5 percent and bounced back from a flat result the year before, and energy companies and banks made some of the largest gains as investors bet on a stronger economy that will lead to more lending and spending. Healthcare companies slumped as drug prices came under intense scrutiny.

Here is a look at how the 11 industry sectors in the S&P 500 fared for the year:

ENERGY: Up 23.7 percent

At the beginning of the year it looked like 2016 would be another painful one for energy companies. In February oil traded at $26 a barrel, down from more than $100 in mid-2014. But over the next few months oil prices rose gradually rose above $50, which reduced the scope of their losses. Late in the year, Organization of the Petroleum Exporting Countries (OPEC) and other oil producers agreed to cut their production in 2017.

FINANCIALS: Up 20.1 percent

Banks and other financial companies sank early in 2016 as investors worried about slowing global economic growth. After that they struggled as the Federal Reserve continually held off on raising interest rates. But the sector caught fire leading up to the election and afterward, as investors felt banks will be major beneficiaries of a Donald Trump administration. Banks stand to benefit from increased government spending and borrowing connected to greater spending on infrastructure, as well as faster economic growth, looser regulations and rising interest rates. Huge gains in the weeks after the election took bank stocks to their highest levels since 2008.

INDUSTRIALS: Up 17.8 percent

Companies that make construction equipment, engines and aircraft also made large gains as the US economy picked up steam. Investors bet that the election of Trump, and a Republican Congress that could approve his spending proposals, will lead to more spending on construction, manufacturing, and transportation.

TELECOM: Up 16.1 percent

Phone company stocks surged early in 2016 as the market got off to a historically bad start. Investors bought those stocks, which are often compared to bonds because of their large dividend yields and relative stability. Low bond yields have helped make the small sector attractive as well, drawing in investors who sought income. Later the stocks gradually lost steam as investors saw signs the economy was picking up and hoped for faster growth. Thanks to AT&T’s biggest gain since 2006, the stocks ultimately bounced back from two years of declines.

MATERIALS: Up 14.1 percent

Companies that make materials like packaging, specialty chemicals and mine for metals also rebounded, partly because precious metals prices bounced back in 2016 after several years of losses. Copper, which is linked to expectations for economic growth because of its uses in construction, climbed 17 percent. Higher metals prices led to big gains for gold and copper producer Freeport-McMoran, gold miner Newmont Mining and steel maker Nucor. Building materials companies like Martin Marietta also climbed.

UTILITIES: Up 12.2 percent

With government bond yields at their lowest levels in many years and investors nervous about the state of the economy, utility companies were in the unusual position of leading the market in early 2016. Electric and gas utilities were a safe harbor for worried investors. But as confidence in the economy picked up, they lost that leadership position. Overall they recovered the previous year’s losses and rose a bit more than the S&P 500.

TECHNOLOGY: Up 12 percent

Technology companies rose for the eighth year in a row. The stocks surged this summer as the US economy appeared to gain strength, while critical overseas markets also looked healthier. The technology sector did not do as well following the election, however, as investors wondered if Trump’s trade and immigration policies and his inflammatory rhetoric would hurt their sales overseas. Graphics processor company Nvidia more than tripled in value and performed better than any other S&P 500 stock, while Hewlett-Packard’s breakup left two stocks that both did well.

CONSUMER STAPLES: Up 2.6 percent

Companies that make and sell common household goods are generally considered a safe investment. But in 2016, investors preferred stocks that will benefit more from faster economic growth. The stocks did rise for the 8th consecutive year, however. Food distributor Sysco climbed 35 percent after it acquired European competitor Brakes, and Wal-Mart made a partial recovery after a 27-percent drop last year.

REAL ESTATE: Up less than 0.1 percent

Real estate has been one of the strongest-performing asset classes in recent years. That has been good news for real estate investment trusts, which were split off as a separate sector this year. Investors poured money into REITs starting in February, when the market reached its recent lows. But starting in the summer, faster growth in the US economy made other types of investments more appealing.

HEALTHCARE: Down 4.4 percent

Drug makers were pummeled in 2016 as their pricing strategies came under repeated criticism and Congressional scrutiny. Investors wondered if the government would intervene to reduce those hikes. Biotechnology companies like Vertex and Alexion were hit especially hard. Endo slumped thanks to legal costs and weak earnings and Mylan fell during a controversy over the rising price of its EpiPen allergy shot. Some insurance companies, including UnitedHealth and Aetna, traded higher. One reason is that Wall Street thinks the possible repeal of the Affordable Care Act will strengthen their profits. Overall, health care stocks fell for the first time since 2008.