Trader Joel Luccese, center, works on the floor of the New York Stock Exchange. Stocks rose broadly in afternoon trading Monday, as the market headed for its fifth straight quarterly gain.

NEW YORK — If 2013 was a year where the stock market went straight up, 2014 has started off as a year where the stock market moves sideways.

There was plenty for investors to worry about in the first three months of the year, from tensions between Russia and the West over Ukraine and the winter storms that froze the U.S. economy in January and February. As a result, investors focused their attention on buying and holding “safe” investments, such as bonds, dividend-paying stocks, and gold.

The Standard & Poor’s 500 rose 1.3 percent in the first three months of 2013. The Dow Jones industrial average lost 0.7 percent so far this year, and the Nasdaq composite is up 0.5 percent.

It was S&P 500’s its fifth-straight quarterly gain. It was also the index’s worst quarter since the fourth quarter of 2012.

“I think this bull market is starting to show signs of fatigue,” said Wayne Wilbanks, chief investment officer at Wilbanks, Smith, Thomas in Norfolk, Va., which manages roughly $2.4 billion in assets.

It was all about safety this quarter.

Utility and health care stocks, which typically pay larger-than-average dividends and are less volatile than other stocks, rose 9 percent and 5.5 percent, respectively. Those two sectors were among the laggards last year.

Bonds were widely expected to do poorly in 2014 because the Federal Reserve was winding down its bond-buying program and the U.S. economy was improving. Instead, they did better than the stock market. The Barclays Aggregate Bond Index, a broad measure of the bond market that includes Treasurys, corporate and other types of bonds, is up 1.9 percent this quarter.

Even gold did well this quarter. After getting slammed in 2013, gold rose nearly 7 percent in the first quarter of 2013.

Investors started off the quarter cautiously optimistic. The S&P 500 had risen 32 percent in 2013, including dividends, and was trading at an all-time high early in the year. There were signs that the U.S. economic recovery was accelerating. Few investors expected 2013’s momentum to hold into this year, however.

“We had such an incredible year last year, people were willing to take a break and wait it out,” said J.J. Kinahan, chief strategist with TD Ameritrade.

Investors quickly had to shift to defense mode. Throughout the first three months of the year, there were signs that the U.S. economy was negatively impacted by severe winter storms in December, January and February, which slowed down job creation, consumer spending and manufacturing nationwide.

Internationally, the tensions between Russia and the West over Ukraine drag on. Geopolitical uncertainty is never good for the stock market.

Then there’s the Federal Reserve. The nation’s central bank began to pull back on its bond-buying economic stimulus in late December, cutting its bond purchases from $85 billion to $75 billion a month. The Fed voted twice this quarter to further cut back the program, which now stands at $55 billion a month.