(AP) -- Wall Street capped a day of mostly sideways trading Monday with a slight gain for the benchmark S&P 500 index, as a spike in crude oil prices sent energy companies broadly higher.
Energy sector stocks climbed as the price of crude oil hit its highest level since October after the U.S. government moved to further block Iranian oil exports.
Even with the surge in energy stocks, losses in banks, real estate companies and elsewhere in the market led to a mostly lower finish for the major U.S. indexes. Smaller company stocks fell more than the rest of the market.
Homebuilders slumped following a report showing that sales of previously owned U.S. homes fell in March.
Monday's listless day of trading was in line with a relatively calm stretch for the U.S. stock market in recent weeks. The market has been hovering near all-time highs after following up a nearly 20% plummet late last year with a nearly mirror-opposite rebound.
Investors are focused on a cavalcade of corporate earnings reports later this week and new data that will give them a read on how much U.S. economic growth slowed during the first three months of the year.
"This week is a crucial week for the market," said Quincy Krosby, chief market strategist at Prudential Financial. "(Investors) want to hear what these companies are saying in terms of their guidance, and that's going to be crucial to see if this market can continue to inch higher."
The S&P 500 wavered between gains and losses for much of the day before eking out a gain of 2.94 points, or 0.1%, to 2,907.97. The index, which had briefly been down as much as 0.3%, is now within 0.8% of its record high set in September.
The Dow Jones Industrial Average fell 48.49 points, or 0.2%, to 26,511.05. The Nasdaq composite gained 17.20 points, or 0.2%, to 8,015.27. The Russell 2000 index of small-cap stocks dropped 5.70 points, or 0.4%, to 1,560.04.
More stocks fell than rose on the New York Stock Exchange.
Bond prices fell. The yield on the 10 year Treasury rose to 2.59% from 2.55% late Thursday.
Energy futures closed broadly higher. Benchmark U.S. crude surged 2.7% to settle at $65.70 per barrel. The leap tacks further gains onto the price of oil, which has been climbing since dropping below $43 in late December. Brent crude rose 2.9% to close at $74.04 per barrel.
The Trump administration said it will no longer exempt any countries from U.S. sanctions if they continue to buy Iranian oil, including China and Japan, the world's second and third largest economies.
President Donald Trump made the move with the intent of bringing Iran's oil exports to zero. Reducing Iran's exports could increase demand for oil from U.S. allies Saudi Arabia and the United Arab Emirates but would heighten political tensions.
"The big fear now and perhaps the markets' next significant catalyst, will Iran retaliate with force?" said Stephen Innes of SPI Asset Management in a report.
The rally in oil prices helped drive energy stocks higher, leading the other 10 sectors in the S&P 500 with a gain of 2.1%.
Marathon Oil climbed 6.6% and Exxon Mobil rose 2.2%.
Communications and technology companies also rose Monday, but those gains were outweighed by losses in banks, real estate and industrial stocks. People's United Financial dropped 2.9%, Simon Property Group lost 2.4% and Boeing fell 1.3%.
Homebuilders declined broadly after a report showing that sales of previously owned U.S. homes fell in March after a huge gain the previous month. The National Association of Realtors said home sales slid 4.9% to a seasonally adjusted annual rate of 5.21 million last month. That followed an 11.2% gain in February, the largest monthly pickup in more than three years.
The March sales tally is the latest sign of a national housing market that's struggling to rebound after slumping in the second half of last year as mortgage rates surged.
Beazer Homes USA was among the biggest decliners, sliding 3.2%.
Traders weighed earnings from several companies Monday.
Intuitive Surgical tumbled 7%, the largest loss in the S&P 500, after the robotic surgery system company reported weaker earnings for the latest quarter than Wall Street expected.
W.W. Grainger dropped 5.5% after the supplier of maintenance, repair and operating products reported weaker revenue for the latest quarter than analysts expected.
Kimberly-Clark gained 5.4% after the maker of Huggies diapers and Kleenex tissue reported stronger earnings and revenue for its latest quarter than analysts expected.
The stock market has been notably calm, with no move for the S&P 500 of more than 0.7% in either direction after April 1.
Bigger moves may be ahead, with a crush of corporate earnings reports due this week. More than a quarter of the companies in the S&P 500 are scheduled to report, including Amazon.com, Exxon Mobil and Facebook.
Expectations are low for earnings in general, and analysts are forecasting the first drop in profit for the S&P 500 in nearly three years. But most companies are reporting stronger profits than Wall Street had been expecting, which is typical.
Later this week, investors will also get a preliminary read on the economy's strength during the first quarter of the year. Economists expect the report to show that growth slowed to 1.8% from 2.2% in the fourth quarter of last year.
In other commodities trading, wholesale gasoline gained 2.8% to $2.13 per gallon, while heating oil rose 1.6% to $2.10 per gallon. Natural gas added 1.4% to $2.52 per 1,000 cubic feet.
Gold inched 0.1% higher to $1,277.60 per ounce, silver rose 0.1% to $14.98 per ounce and copper fell 0.6% to $2.90 per pound.
The dollar edged up to 111.94 Japanese yen from 111.93 yen late Friday. The euro strengthened to $1.1259 from $1.1246.