U.S. stocks rallied on Monday as investors shook off trade concerns and unrest in the Middle East.

Continue Reading Below

All three of the major market averages rose, ending the final day of the third quarter on a high note.

Ticker Security Last Change Change % I:DJI DOW JONES AVERAGES 27173.96 +358.52 +1.34% I:COMP NASDAQ COMPOSITE INDEX 10913.561787 +241.30 +2.26% SP500 S&P 500 3298.46 +51.87 +1.60%

In fact, it marks the best three-quarters percentage-wise for the S&P 500 in seven years with a gain of 18 percent, as tracked by Dow Jones Market Data Group.

In stock news, Apple shares rose over 2 percent after JPMorgan Chase raised its price target to $265 a share - 21 percent above Friday's closing level - due to anticipation of stronger iPhone sales. CEO Tim Cook, speaking at the firm's investment conference, said iPhone sales are off to a strong start.

Elsewhere, Bed Bath & Beyond gained after Wedbush upgraded the name, saying it sees a turnaround taking hold. The home retailer has been under siege from a trio of activist investors.

Ticker Security Last Change Change % AAPL APPLE INC. 112.28 +4.06 +3.75% BBBY BED BATH & BEYOND INC. 14.53 +0.60 +4.31%

AB InBev gained after the brewer's Asia unit jumped more than 4 percent after its Hong Kong initial public offering.

Ticker Security Last Change Change % BUD ANHEUSER-BUSCH INBEV 52.82 -0.06 -0.11%

In global news, Saudi Crown Prince Mohammed bin Salman on Sunday evening appeared on "60 Minutes," saying a war with Iran would cause oil prices to skyrocket and be a catastrophe for the global economy.

“The region represents about 30 percent of the world's energy supplies, about 20 percent of global trade passages, about 4 percent of the world GDP,” bin Salman said. “Imagine all of these three things stop. This means a total collapse of the global economy, and not just Saudi Arabia or the Middle East countries.” Global oil prices declined on Monday.

In Asia, Chinese manufacturing data was slightly better than analysts' estimates, helping to boost sentiment which lifted Asian markets across the board.

Chinese markets will trade only on Monday, then close for the country's National Day holiday, which runs until Oct. 7. China will be celebrating the 70th anniversary of communist rule.

CLICK HERE TO READ MORE ON FOX BUSINESS

Demand for Chinese goods has been hurt by weakening domestic and global economic growth as well as U.S. tariff hikes in a fight over trade and technology.

Negotiators are due to meet next month in Washington but there has been little signs of progress toward ending the dispute.

The Associated Press and FOX Business' Ken Martin and Suzanne O'Halloran contributed to this article.