(Reuters) - The S&P 500 rallied for a second straight session on Wednesday as the U.S. Senate appeared near a vote on a $2 trillion package to support businesses and households devastated by the coronavirus pandemic.

Wall Street trimmed hefty gains late in the session after reports raised doubts about how quickly the bill might pass, but the S&P 500 and Dow Jones Industrial Average still ended up more than 1% and 2%, respectively.

Boeing surged 24%, bringing its gain over the past three sessions to almost 70%, as investors bet on government support for the aerospace industry as well as airlines. American Airlines Group AAL.O, United Airlines Holding UAL.O and Delta Air Lines DAL.N each jumped more than 10%.

Boeing, long a symbol of U.S. manufacturing strength, remains down by more than 50% since mid-February.

Wednesday marked the first time since Feb. 12 that S&P 500 climbed two days in a row. Even after its late-day retreat from its highs, the Dow’s 14% gain over two sessions was its strongest two-day percent performance since 1987.

“What the fiscal and monetary stimulus has done is to allow the market to recover,” said Justin Hoogendoorn, head of fixed income strategy at Piper Jaffray in Chicago. “It’s not because the main street community is coming back. It’s the institutional crowd being able to say, ‘the world isn’t falling apart’.”

Top aides to Republican President Donald Trump and senior Senate Republicans and Democrats said they had agreed on the unprecedented stimulus bill, which includes a $500 billion fund to help hard-hit industries and a comparable amount for direct payments of up to $3,000 apiece to millions of U.S. families.

However, Senator Bernie Sanders, an independent who is running for the Democratic presidential nomination, said he was prepared to put a hold on the bill unless a group of Republican senators drop their objections to language on jobless benefits in the legislation.

Top House Republican Kevin McCarthy said he wanted House members to have at least 24 hours after the Senate vote to review the bill.

With fears of a global recession and corporate defaults running high, and expectations of a continued surge in cases of the illness caused by the new coronavirus in the United States, many investors remained reluctant to call an end to Wall Street’s recent, staggering selloff.

“We are still in a phase where we need to be cautious,” warned Rob Haworth, senior investment strategist for U.S. Bank Wealth Management. “We don’t yet know when these social distancing measures will end, and the evidence for now is that they will continue to expand.”

Data due on Thursday is likely to show U.S. weekly jobless claims surging to 1 million as companies announce layoffs and as state-wide lockdowns force businesses to shutter stores.

Apple Inc AAPL.O fell late in the session, closing down 0.55% after Nikkei reported the company could delay the launch of an iPhone with 5G wireless technology.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., March 20, 2020. REUTERS/Lucas Jackson

The Dow Jones Industrial Average .DJI rose 2.39% to end at 21,200.55 points, while the S&P 500 .SPX gained 1.15% to 2,475.56.

The Nasdaq Composite .IXIC dropped 0.45% to 7,384.30, giving up its earlier gains.

The S&P 500 remains down about 27% from its February record high, a loss of more than $7 trillion in stock market value.

Royal Caribbean Cruises RCL.N and Norwegian Cruise Line Holdings NCLH.N each rallied about 23%. Both companies have been among the hardest hit from the pandemic.

Advancing issues outnumbered declining ones on the NYSE by a 4.55-to-1 ratio; on Nasdaq, a 2.02-to-1 ratio favored advancers.

The S&P 500 posted no new 52-week highs and 4 new lows; the Nasdaq Composite recorded 4 new highs and 57 new lows.