NEW YORK — Despite losing a big chunk of customers last year, shares in Blue Apron rose after the company reported slimmer losses than Wall Street had expected.

The mail-order meal kit company, which cut its marketing budget to focus on current subscribers and operational improvements, reported a loss of $39.1 million in its fourth quarter. While the company lost about 15 percent of its customer base over the previous year, Blue Apron said the customers it retained spent more money.

Blue Apron’s average revenue per customer was $248 in the fourth quarter of 2017 compared to $246 in the fourth quarter of 2016, and $3 better than the third quarter of 2017.

On a per-share basis, the New York-based company said it had a loss of 20 cents, surpassing Wall Street expectations. The average estimate of eight analysts surveyed by Zacks Investment Research was for a loss of 27 cents per share.

Blue Apron posted revenue of $187.7 million in the period, also beating Street forecasts. Six analysts surveyed by Zacks expected $182.8 million.

For the year, the company reported a loss of $210.1 million, or $1.64 per share. Revenue in 2017 was reported as $881.2 million, up 11 percent over the $795.4 million the prior year.

The company’s shares rose more than 20 percent in early trading, before settling up nearly 6 percent, or 20 cents, at $3.54 in morning trading. Shares in Blue Apron Holdings Inc. have lost about two-thirds of their value since the company went public last June.

Blue Apron has been facing increasing competition from Germany’s HelloFresh, Amazon and Alberstons. Amazon, which bought grocer Whole Foods, is testing its own meal kits, and supermarket operator Albertsons bought rival Plated and plans to sell kits at its 2,300 stores.

Blue Apron cut about 320 jobs in October, about 6 percent of its workforce.

_____

Elements of this story were generated in part by Automated Insights (http://automatedinsights.com/ap) using data from Zacks Investment Research. Access a Zacks stock report on APRN at https://www.zacks.com/ap/APRN