U.S. stocks rallied Monday, with each of Wall Street's main indexes closing at record levels as President Donald Trump's signing of a long-awaited $2.3 trillion budget bill that includes pandemic aid increased optimism for an economic recovery.

In a sudden reversal late Sunday, Trump backed down from his threat to block the hard-fought bill, restoring unemployment benefits to millions of Americans and averting a federal government shutdown.

Unofficially, the Dow Jones Industrial Average rose 207.58 points, or 0.69%, to 30,407.45, the S&P 500 gained 32.34 points, or 0.87%, to 3,735.4 and the Nasdaq Composite added 94.69 points, or 0.74%, to 12,899.42.

Stocks battered by coronavirus lockdowns, such as airlines and cruise lines, advanced. The S&P 1500 airlines index gained as carriers are set to receive $15 billion in addition payroll assistance under the new government aid.

Cruise operators Royal Caribbean Cruises Ltd, Carnival Corp and Norwegian Cruise Line Holdings Ltd each rose by at least 3%

On a sector basis, gains were led by communication services, consumer discretionary and tech as each climbed more than 1%.

After a sharp recovery from a coronavirus crash in March, the S&P 500 is on track to rise more than 15% this year on the back of a loose monetary policy and a COVID-19 vaccine program that has raised hopes the economic environment will improve.

Despite the generally favorable conditions for equities, worries over a resurgence in coronavirus cases, upcoming U.S. Senate runoffs in Georgia and stretched valuations could become headwinds. The forward price-to-earnings ratio of the S&P is currently about 22.2, well above its long-term average of 15.3.

Adding to a global appetite for risk, Britain and the European Union clinched a lean post-Brexit trade deal Thursday, while a mass COVID-19 vaccination drive in Europe was launched over the weekend.