By Avantika Chilkoti, Chong Koh Ping and Gunjan Banerji
U.S. stocks edged up Friday, heading toward a second consecutive month of strong gains.
Investors have been encouraged in recent weeks by signs of states and businesses around the country reopening and stimulus measures from the Federal Reserve, helping stocks rebound from their March lows.
The S&P 500 and Dow Jones Industrial Average have both added 4% in May, building on April's robust rally when the indexes posted their best monthly percentage gains since 1987.
The two-month rally has cut the indexes' losses for the year to about 6% and 11%, respectively.
The technology-heavy Nasdaq Composite has risen almost 7% this month and is up more than 5% for 2020.
The rally was initially led by tech heavyweights. But that has shifted over the past two weeks and the latest leg of the rebound has been underpinned by shares of companies that were considered the stock market's laggards just weeks ago.
Investors have turned to shares of financial companies and cooled toward the tech giants. Financial companies in the S&P 500 have jumped 6.6% this week, while the information-technology sector has inched up 1.4%.
To many observers, the climb in value stocks, which typically trade at low multiples of their book values, was a sign that investors are bracing for a broader economic recovery ahead.
"People keep rotating back and forth" between shares of companies that will do well if the economy continues to reopen and stocks that will thrive if people stay at home, said Ilya Feygin, managing director at WallachBeth Capital. "That's the major issue that people are grappling with."
Some investors have said that the worst is over for the domestic economy.
Fresh data Friday showed that U.S. consumer spending fell by a record 13.6% in April during coronavirus lockdowns. But there are signs that purchasing is starting to pick up as states start to reopen businesses and Americans return to work.
The University of Michigan's closely watched survey showed that a measure of consumer sentiment rose in May from April.
"In my mind we have hit bottom," said Eddie Perkin, chief equity investment officer at Eaton Vance. But, he added "I think it will be awhile before we get back to fully recovered."
The sharp rally in stocks this week came to a stuttering halt Thursday after Mr. Trump said he would hold a Friday news conference about China.
China and the U.S. have been on a collision course in recent days following Beijing's moves to clamp down on antigovernment protesters in Hong Kong by imposing national-security laws on the city. Fresh U.S. measures targeting trade and Chinese companies could weigh on both economies at a time when they are already struggling with the coronavirus pandemic, analysts said.
Any U.S. measures on trade or against Chinese companies, and any Chinese retaliation, could have a greater impact than previous actions taken before the new coronavirus battered both economies, according to Colin Low, senior macro analyst at FSMOne.com in Singapore.
That sentiment weighed on stocks Friday. Major indexes swung between small gains and losses for much of the session. The Dow Jones Industrial Average was down 17 points, or about 0.1%, as of 4 p.m. Eastern time. The S&P 500 added 0.5%. The Nasdaq Composite rose 1.3%.
The pan-continental Stoxx Europe 600 dropped 1.4%. Most major Asia-Pacific equity benchmarks closed lower, while the Hong Kong gauge lost 0.7%.
The yield on the benchmark 10-year U.S. Treasury note edged down to 0.667%, according to Tradeweb, from 0.703% Thursday. Yields fall as bond prices rise.
Among individual stocks, Dell Technologies rallied 7.1%. The computer maker on Thursday said the pandemic has boosted its business in certain sectors. Software maker VMware, which is majority owned by Dell, climbed 7.8% after its earnings topped Wall Street's expectations.
Salesforce.com dropped 4.4% after the business-software maker cut its earnings outlook.
Write to Avantika Chilkoti at Avantika.Chilkoti@wsj.com, Chong Koh Ping at firstname.lastname@example.org and Gunjan Banerji at Gunjan.Banerji@wsj.com