By Alexander Osipovich and Jem Bartholomew

The S&P 500 rose to a new record Friday as optimism over a Covid-19 vaccine raised hopes of an economic recovery next year.

Both the S&P and the Dow Jones Industrial Average notched their second consecutive week of gains, as investors piled into previously underperforming sectors like energy and banks.

In a striking reversal, investors this past week pulled away from the highflying technology stocks that had powered the market higher since March, and shifted into economically sensitive stocks seen as likely to benefit from a post-pandemic recovery.

The Dow industrials climbed 399.64 points, or 1.4%, to close at 29479.81. The blue-chips index rallied 4.1% for the week.

The S&P 500 rose 48.14, or 1.4%, to 3585.15, its first record close since September. The broad-based index gained 2.2% for the week.

The tech-heavy Nasdaq Composite rose 119.70, or 1%, to 11829.29, recovering some ground from recent days but still lagging behind the others with a 0.6% weekly loss.

The last week when the Dow outperformed the Nasdaq by such a wide margin was 2002, according to Dow Jones Market Data.

Among the week's biggest losers were companies that had benefited from the stay-at-home trade -- businesses that can prosper when lockdown measures force people to spend more of their work and leisure time at home. Amazon.com and Facebook both fell more than 5% this past week, while videoconferencing firm Zoom Video Communications slumped 19%.

Winners included Chevron, which gained 17% in its best week since 2008, and pharmacy chain Walgreens Boots Alliance, whose shares rose 14%.

Smaller stocks, which were hammered by the coronavirus selloff in March, roared back. The Russell 2000 has gained 13% this month, and it closed at a record high on Friday for the first time in more than two years.

"This is an environment where the recovery trade, which is favorable to value, really still has legs," said Samy Chaar, chief economist at Lombard Odier. "The market is starting to focus on 2021, and giving credit to the cyclical recovery."

The catalyst for the shift was news on Monday that a coronavirus vaccine being developed by Pfizer and partner BioNTech was more than 90% effective, according to early data. That set off a wave of euphoria, with the Dow surging more than 800 points for the day.

The vaccine news came as markets were generally welcoming the outcome of the U.S. election, in which former Vice President Joe Biden beat President Trump, even as it appeared the Senate would remain under Republican control. Investors often favor divided government, because it reduces the chance of major regulatory changes that can unsettle markets.

Phillip Toews, chief executive of Toews Asset Management, said that after the Pfizer-BioNTech news, his firm bought stocks and exited defensive positions in cash and bonds, as it appeared that the world could be turning the corner on the pandemic.

"Now we're fully bullish across our equities and high-yield bonds platforms," Mr. Toews said.

Still, many investors remain cautious about the coming winter because of elevated coronavirus infection levels. The U.S. on Thursday for the first time reported more than 150,000 new coronavirus cases in a single day, driven by record infection counts in more than a dozen states.

"Over the next few weeks, the likelihood is we're going to see greater volatility. You have a number of systemic risks that could occur," said Justin Onuekwusi, head of retail multiasset funds at Legal & General Investment Management. "You've got vaccine news, you've got economic growth being impacted by lockdowns, Brexit news, U.S. election news -- all of it's quite volatile."

All 11 sectors of the S&P were in positive territory on Friday, with energy and industrial stocks among the best-performing sectors.

Tech stocks regained some lost ground, led by Cisco Systems. Shares of the network-equipment firm climbed $2.73, or 7.1%, to $41.40 after its earnings beat Wall Street projections.

Palantir Technologies stock jumped $1.22, or 8.4%, to $15.80 after the data-analysis company raised its revenue outlook late Thursday and posted better-than-expected sales in its first quarterly report since going public in September.

Overseas, the Stoxx Europe 600 ended the day roughly flat. Major Asian equity benchmarks were mostly lower, with Japan's Nikkei 225 falling 0.5% while the Shanghai Composite Index dropped 0.9%.

Some Chinese stocks fell sharply after President Trump on Thursday signed an order barring Americans from investing in companies deemed to help China's military, intelligence and security services.

China's three main telecoms operators were among the hardest hit, with shares of China Mobile, China Unicom and China Telecom retreating over 5% in Hong Kong trading.

In bond markets, the yield on 10-year Treasury notes ticked up to 0.892%, from 0.885% on Thursday.

Write to Alexander Osipovich at alexander.osipovich@dowjones.com

(END) Dow Jones Newswires

11-13-20 1738ET