Local drugmaker Arena Pharmaceuticals Inc. saw its stock surge nearly 13 percent Wednesday following an earnings report that impressed investors.

The company, which makes the weight loss drug Belviq, reported net income of $38.6 million for the fourth quarter of 2016, compared to a loss in the same period the prior year. For the quarter, that equates to net income of 16 cents per share, which exceeded Wall Street’s expectations. Three analysts surveyed by Zacks Investment Research were expecting a loss of 9 cents per share for the quarter.

The drugmaker posted revenue of $85.4 million for the quarter, up from $7.8 million in Q4 2015.

The improved financial situation has much to do with Arena’s decision to amend its licensing agreement with its partner Eisai Co., which resulted in a $10 million payment during Q4. The new agreement is expected to lower the company’s clinical costs by around $80 million over the next three years.

For the full year 2016, Arena reported $124 million in revenue, up from $38.3 million in 2015. The bump in revenue narrowed the company’s loss to $22.5 million in 2016, compared to a $108 million loss in 2015.