NEW YORK (AP) -- Stocks barreled higher in the early going Monday after the U.S. and Canada agreed to a new trade deal, but the rally ran out of momentum later in the day, leaving major indexes mixed.
Oil prices neared four-year highs and smaller companies suffered their worst losses in three months.
Large industrial and basic materials stocks made big gains, and energy companies rose as crude oil and natural gas reached their highest prices in years. Car companies also rose as investors anticipated that tariffs on imported cars are less likely now.
Many investors saw the new trade deal, the United States-Mexico-Canada Agreement, as an update of the 1994 North American Free Trade Agreement, not a major overhaul.
"Most investors thought the NAFTA deal would end somewhat peacefully," said Mark Hackett, chief of investment research at Nationwide Investment Management. "It's an incremental positive to get it out of the news but it's not transformational."
General Electric soared after it ousted Chairman and CEO John Flannery, while Tesla reversed a big loss Friday and made its largest gain in five years after founder Elon Musk settled a lawsuit brought by securities regulators, allowing him to remain CEO.
The S&P 500 index rose as much as 23 points during the day, then finished with a gain of 10.61 points, or 0.4 percent, at 2,924.59. The Dow Jones Industrial Average jumped 192.90 points, or 0.7 percent, to 26,651.21. The Nasdaq composite lost 9.05 points, or 0.1 percent, at 8,037.30.
Mexico's main stock index rose 0.8 percent and while Canada's added 0.2 percent. Mexico and the U.S. announced a trade agreement in late August and despite a few harsh remarks by President Donald Trump and Prime Minister Justin Trudeau, experts expected Canada would join the pact, as Canada is the U.S.' second-largest trade partner and a deal without Canada would have affected the supply lines of companies in numerous industries.
The Russell 2000 index of smaller and more U.S.-focused companies sank 23.58 points, or 1.4 percent, to 1,672.99. That was its worst loss since late June. The index has lost 3.9 percent since the end of August while multinational companies, like those on the S&P 500, have moved higher.
The agreement gives U.S. dairy farmers more access to the Canadian market, and keeps a NAFTA dispute-resolution process that the U.S. wanted to eliminate. It offers Canada protection if the U.S. goes ahead with plans to impose tariffs on cars, trucks and auto parts imported into the United States. General Motors climbed 1.6 percent to $34.20.
Among industrial companies, Boeing rose 2.8 percent to $382.29 and Honeywell gained 1.1 percent to $166.44. General Electric jumped 7.1 percent after it said Flannery will be replaced by H. Lawrence Culp, the former CEO of industrial and medical device company Danaher.
Flannery took over GE from Jeffrey Immelt in 2017 and tried to return the company to its industrial roots by focusing on aviation, health care and power. Some investors wanted him to go further and felt GE should split up.
His tenure was marked by big missteps. In June GE said it would pay $15 billion to make up for miscalculations by an insurance division, and in September the company disclosed flaws in its marquee gas turbine. On Monday GE said it is taking a $23 billion charge related to its power business and will miss its annual profit target. Its stock has fallen by half over the last year.
Tesla soared 17.3 percent to $310.70 after Musk agreed to give up the chairman's role for at least three years, while Tesla will appoint two new, independent directors to its board. The stock plunged 14 percent Friday after the Securities and Exchange Commission said Musk misled investors in August with a tweet saying he had secured the funding to take Tesla private.
In a court filing, the SEC said it wanted to bar Musk from serving as an officer or director of a publicly traded company and called his actions securities fraud. Musk and Tesla are each paying $20 million to resolve the lawsuit.
Benchmark U.S. crude climbed 2.8 percent to $75.30 a barrel in New York, its highest closing price since November 2014. Brent crude, used to price international oils, added 2.7 percent to $84.98 per barrel in London. It's also trading at four-year highs.
Wholesale gasoline rose 2 percent to $2.13 a gallon. Heating oil added 2.5 percent to $2.41 a gallon. Natural gas jumped 2.9 percent to a three-year high of $3.09 per 1,000 cubic feet.
Hackett, of Nationwide, said the recent rise in oil prices is a bigger problem for small companies than it is for larger multinationals.
Bond prices fell. The yield on the 10-year Treasury note rose to 3.09 percent from 3.05 percent.
Gold fell 0.4 percent to $1,191.70 an ounce. Silver lost 1.4 percent to $14.51 an ounce. Copper slid 0.6 percent to $2.79 a pound.
The dollar rose to 113.99 yen from 113.58 yen. The euro dipped to $1.1575 from $1.1610. The Canadian dollar fell to 1.2787 from 1.2922.
Germany's DAX added 0.8 percent while the CAC 40 in France advanced 0.2 percent. Britain's FTSE 100 fell 0.2 percent. After a sharp drop Friday, Italy's FTSE MIB lost another 0.5 percent as investors worried about the new government's plan to increase spending. The index has fallen 16 percent in the last five months.
Japan's benchmark Nikkei 225 gained 0.5 percent and South Korea's Kospi gave up 0.2 percent. Markets in Hong Kong and the Chinese mainland were closed for National Day holidays.