Utilities stocks are an affordable way to gain exposure to artificial intelligence trends and hedge against an economic slowdown, according to Goldman Sachs, even after the sector's recent surge. Utilities have risen nearly 18% over the past three months, making them the best-performing sector in the S&P 500 over that period. The three-month return is one of the sector's best performances in the past 20 years, behind only the 2003 and 2020 surges, according to Goldman. Still, utilities stocks remain relatively affordable. The sector's price-to-earnings multiple is just 6% relative to the S&P 500 equivalent, roughly in line with its historical median, according to the investment bank. “Despite the surge, utilities offer AI and defensive exposure at less demanding valuations,” analysts led by Ryan Hammond told clients in a research note on Wednesday. The long-term growth outlook for the utilities sector is improving, analysts said, due to rising power demand from data centers and AI. According to the firm, utility capital expenditures are expected to grow by about 36% over the next three years compared to 2020-2023. Goldman projects above-consensus earnings growth of an average of 2% in 2026 for the 16 utility stocks it covers. NextEra, Xcel Energy, Sempra and Southern Company have the highest exposure to a surge in data center power demand among Goldman's buy recommendations, according to Goldman. Goldman also gives buy recommendations to American Electric Power, Eversource Energy and FirstEnergy. Utilities also act as a hedge against a slowing economy, according to Goldman. “This environment, or a less severe negative growth shock, would favor the inclusion of defensive industries such as utilities in portfolios,” Goldman's analyst team said. However, interest rates are a potential headwind for the sector. Utilities typically underperform when bond yields rise. Rising interest rates would raise borrowing costs for these companies and also make stock dividend yields less attractive compared to the risk-free yields on Treasuries. But the Federal Reserve has signaled that rate hikes are off the table, and Goldman's interest rate strategists aren't calling for higher yields. “However, a return to a rising bond yield environment could weigh on utilities' performance,” Goldman analysts said.