Powered by a healthy bump in same-store sales, Macy’s (M) logged a stronger-than-expected 16% rise in second-quarter profits on Wednesday and unveiled a more bullish outlook for the full year.

Inspired by the upbeat earnings and guidance, Wall Street bid shares of the iconic department store 3% higher in early trading.

Macy’s said it earned $279 million, or 67 cents a share, last quarter, compared with a profit of $241 million, or 55 cents a share, a year earlier. Analysts had been calling for EPS of 64 cents.

Unlike many big companies, Macy’s also managed to narrowly top the Street’s revenue view by growing sales 3% to $6.12 billion.

The department-store operator posted a 3% increase in same-store sales and said online sales soared 36%. Online sales boosted the company’s same-store sales by 1.7 percentage points.

“Our business continues to have forward momentum, even with challenges that include a soft economy, lower spending by international tourists” and a remodeling of its flagship Manhattan store, CEO Terry Lundgren said in a statement.

Management impressed shareholders by upgrading its guidance for the full year despite recent turbulence in the economy.

Macy’s now expects to generate 2012 EPS of $3.30 to $3.35, up from $3.25 to $3.30 previously. Analysts are projecting full-year EPS of $3.36. Macy’s said same-store sales are still seen rising 3.7%.

“We are entering the fall season with optimism about our ability to grow sales and capture market share,” said Lundgren. “The direction of the overall economy is outside of our control, so we will concentrate on what our company does best.”

Shares of Cincinnati-based Macy’s gained 2.7% to $38.00 in premarket action on Wednesday, putting them in position to build on a 2012 rally of 15%.

Follow Matt Egan on Twitter @MattMEgan5