3-D printing firm Stratasys Ltd. ended years of steep losses and produced a second-quarter profit that beat Wall Street expectations.

Stratasys, which was founded in Minnesota and now has dual headquarters in Eden Prairie and Israel, on Wednesday said it earned $1.2 million, or 2 cents a share, from April through June. It had a loss of $3.6 million in the same quarter one year ago and a loss of $2.3 million in the first quarter of this year.

Excluding one-time items, Stratasys earned $8.5 million, or 16 cents a share, a penny better than analysts expected, on average, and up 5% from year-ago adjusted results.

Sales fell 4.3% to $163.2 million, missing average analysts’ estimates by about $5 million.

The return to profitability was welcome news for the 3-D printer manufacturer that has struggled with growing competition and some product stumbles.

Last year, Stratasys’ revenue reached $663 million and the company lost $11 million, significantly less than the $120 million lost in 2014 or the $40 million lost in 2017.

With newly positive second-quarter profits, company executives hope this will be the start of consistent growth, at least on an adjusted basis.

“We are pleased that our emphasis on operational efficiency delivered earnings and profitability while we continue to invest in new products and strengthen our R&D efforts,” Elan Jaglom, the company’s interim chief executive, said in a statement.

He said the company performed well in the Americas but contended with economic weakness in Europe and the effect of converting foreign currency into U.S. dollars.

“We believe that we are well positioned to return to growth in Europe when macro conditions improve, and our new products and platforms are launched and adopted in the market,” Jaglom said.

But the company is still not out of the woods. For full-year 2019, Stratasys now expects revenue to reach between $670 million and $700 million a year, but it also expects a net loss of between $3 million and $17 million (or negative 5 cents to 30 cents a share), officials said.

Stratasys’ stock price fell nearly 2% to close at $27.89 a share Wednesday. The price is up from $18 in January. Back in 2014, the stock was $120 a share.