"We're hopeful that geopolitical tensions will ramp down," said Jim Russell, a regional investment director at US Bank. "The fundamental economic backdrop remains pretty firm, even though investment sentiment remains less than certain."
The Standard & Poor's 500 index rose 5.33 points, or 0.3 percent, to 1,936.92. The Dow Jones industrial average climbed 16.05 points, or 0.1 percent, to 16,569.98 percent. The Nasdaq composite gained 30.43 points, or 0.7 percent, to 4,401.33.
Kinder Morgan was the biggest gainer in the S&P 500. The energy company rose $3.25, or 9 percent, to $39.37 after the company said Sunday that the group of oil and gas pipeline and storage companies that it controls will combine.
Investors were also tracking corporate earnings reports.
Shares of Priceline Group rose $27.72, or 2.2 percent, to $1,309.20 after the company reported second-quarter earnings that topped Wall Street expectations. The online travel company said the summer season got off to a strong start. Shares of rival Expedia gained $1.39, or 1.7 percent, to $83.94.
More than 90 percent of the companies in the S&P 500 index have now reported earnings for the second quarter.
Company earnings are expected to grow by 10.1 percent in the period, according to data from S&P Capital IQ. That compares with growth of 4.9 percent in the second quarter last year and growth of 3.4 percent in the first quarter.
Stocks have also been getting a lift as the flow of mergers and acquisitions has picked up this year.
On Monday, Chiquita Brands International surged $3.04, or 30 percent, to $13.10 after the company received a buyout offer from investment firm Safra Group and the Brazilian agribusiness and juice company Cutrale Group.
Safra and Cutrale are offering $13 per share, a 29 percent premium to Chiquita's closing price of $10.06 on Friday. Chiquita said its board would review it and asked shareholders to await its recommendation. The unsolicited bid disclosed Monday comes as Chiquita and Fyffes of Ireland were working on their own transaction. The two companies agreed in March to merge in a stock-for-stock deal to create the world's biggest banana supplier.
Even though stocks have rallied over the last two days, investors should get used to the prospect of increased volatility in the market as the Federal Reserve nears the end of its economic stimulus program and gets closer to raising interest rates, said Kristina Hooper, US Investment Strategist at Allianz Global Investors.
"Stocks are a lot more vulnerable with markets pricing in a less accommodative Fed," said Hooper.
U.S. government bond prices were little changed. The yield on the 10-year Treasury note held at 2.42 percent from Friday, close to its lowest level in a year.
Longer-dated Treasury notes and bonds have surged this year even though the Federal Reserve is winding down its economic stimulus and purchasing fewer bonds. Analysts say that demand for the notes has increased because the yields on the bonds of other developed nations have fallen further. The yield on the 10-year German government bond is 1.06 percent and the yield on France's government bonds with a similar maturity is 1.47 percent.
In commodities trading, gold was little changed at $1,310.50 an ounce. Silver rose 15 cents, or 0.8 percent, to $20.10 an ounce. Copper was little changed at $3.18 a pound. The price of oil rose 43 cents, or 0.4 percent, to $98.08.