Stratasys Ltd. beat Wall Street expectations while recording a loss for its latest quarter — but it was much less than in the same period a year ago and, excluding one-time items, the adjusted earnings were in the black.

The news initially sent the company's stock up, but then it fell throughout the day to close at $20.79, down 1.3 percent.

For the quarter, the long-struggling Eden Prairie maker of 3-D printers reported a net loss of $21.1 million, or 44 cents a share, far better than the $221 million loss reported a year ago. Excluding one-time items, adjusted profits reached a positive $4 million, or a penny per share.

Sales fell to $168 million from $173 million a year ago, yet both earnings and sales exceeded Wall Street expectations. On average, analysts had predicted adjusted earnings to be a loss of 4 cents per share on sales of $164 million.

Stratasys has suffered from heightened competition in the once-novel 3-D printing manufacturing sector and is restructuring at the same time. Not quite two years ago it greatly expanded its desktop consumer models into Staples and other big retailers, only to have product defects derail the effort.

Now, the company is focusing mainly on new advanced 3-D printers that can be used by contract manufacturers to make high-tech components for large industrial clients and by customers such as hospitals and airplane makers. The company's newest machines have succeeded in integrating the printing of various materials such as silicone, rubber, plastics and metals.

At the same time, Stratasys has cut costs dramatically.

"Although the overall market environment remains challenging, we made significant progress in improving our operating efficiency during the first quarter, which is demonstrated by the favorable trends we observed in operating expenses and cash generation during the period," said CEO David Reis in a statement. "We believe the recent refinements to our operating structure will make us more productive and better position us for future growth."

For the full fiscal year, Stratasys estimates revenue between $700 million and $730 million and a loss of $67 million to $84 million, or $1.28 to $1.60 a share. When adjusted for one-time items, earnings would be in positive territory of $9 million to $23 million, or 17 to 43 cents a share.