Solid earnings from Ford, 3M Co and United Parcel Service lifted stocks on Tuesday, but the rally to around three-year highs may face a hurdle as the Federal Reserve begins a policy meeting.

Corporate earnings have been generally strong so far this season, with around three-quarters of S&P 500 companies beating analysts' forecasts so far. The three major indices hit highs for the year, erasing losses after a dip in February.

But investors were cautious with the Fed set to release on Wednesday its last policy statement before it is expected to stop its quantitative easing program at the end of June.

Investors will be looking for a shift in tone from the Fed relative to its outlook for inflation being benign and in addition to that any whiff of anticipation as to what could happen at the end of June, said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia.

One concern is that ending the stimulus program could remove support for buying stocks.

At the end of the meeting on Wednesday the Fed will hold a news conference when it will face questions about the shape of monetary policy after its $600 billion bond buying spree ends.

The Dow Jones industrial average <.DJI> rose 81.89 points, or 0.66 percent, at 12,561.77. The Standard & Poor's 500 Index <.SPX> added 10.11 points, or 0.76 percent, at 1,345.36. The Nasdaq Composite Index <.IXIC> gained 20.26 points, or 0.72 percent, at 2,846.14.

Both the S&P 500 and the Dow are at their highest level in nearly three years. The Nasdaq was at its highest since late 2007.

The S&P 500 and the Nasdaq are up over 7 percent this year. The Dow is up more 8 percent.

United Parcel Service , an economic bellwether that handles a large chunk of the world's business deliveries, said the global economic outlook was a little cloudier than three months ago, but at the same time it said it sees record earnings in 2011. The shares rose 1.2 percent to $74.49.

UPS was probably the most important for the market today since its so broad-based in the state of transportation and logistics, said Mike Shinnick, a portfolio manager at Wasatch-1st Source Long/Short Fund in South Bend, Indiana.

There's potential there for a pinch from fuel, but it looks like they're managing it quite well, he said.

Ford Motor Co reported its best first-quarter profit in 13 years, driven by strong sales in its home market and demand for more fuel-efficient vehicles, sending its shares up 2.7 percent to $15.96.

Industrial and consumer goods conglomerate 3M reported higher-than-expected quarterly profit, helped by sales to emerging markets, and raised its full-year profit forecast. The company's shares rose 2.1 percent to $96.02.

On the downside, Coca-Cola Co's quarterly results slightly missed Wall Street estimates, as the Japan earthquake and the timing of marketing expenses overshadowed strong sales volume. Its shares fell 2.3 percent to $66.17.

U.S. consumer confidence rose in April as inflation expectations eased somewhat and consumers felt better about the short-term outlook, according to a private sector report. The data helped ease concerns that the recent rise in oil prices have started to hit shoppers.

(Editing by Kenneth Barry)