Nike (NKE) disclosed an 18% slide in fiscal second-quarter profits on Thursday amid slumping sales in China, but the apparel and sneaker maker’s earnings still topped forecasts from analysts. 

Shares of Nike, which have been stagnant for much of this year, turned about 3% higher on the stronger-than-expected numbers.

The company said it earned $384 million, or $1.14 a share, last quarter, compared with a profit of $469 million, or $1.05 a share, a year earlier. Analysts had been calling for EPS of $1.00.

Despite a double-digit decline in Greater China, overall revenue rose 7% to $5.96 billion, nearly matching the Street’s view of $5.99 billion. Excluding the impact of currency fluctuations, revenues would have climbed 10%.

However, gross margins shrank for the eighth quarter in a row, dropping to 42.5% last quarter from 42.8% the year before amid higher labor costs and unfavorable forex rates.

Nike said global futures orders, a closely-watched metric, climbed 6% year-over-year last quarter to $9.3 billion. Excluding currency changes, orders would be up 7%.

“Our strong second quarter results show that our growth strategies are working, even under challenging macroeconomic conditions,” CEO Mark Parker said in a statement.

Revenue in North America soared 17% to $2.42 billion last quarter, compared with a 2% dip in Western Europe to $897 million and a 2% gain in Central and Western Europe to $266 million.

Importantly, sales in Greater China dropped 11% to $577 million, highlighted by a 16% plunge in apparel revenue to $224 million. Sales in Japan rose 11% to $219 million.

Total selling and administrative expenses grew 6% to $1.84 billion. Nike said its inventories at quarter-end stood at $3.3 billion, up 9% from a year earlier.

Shares of Nike rallied 3.13% to $102.10 in extended action on Thursday, building on a 1.25% gain during regular trading.

The results came after Nike and Oregon reached a deal to keep the apparel company in the state. In exchange for a promise to calculate Nike’s state taxes the same way for 30 years, the company pledged to make a capital investment of at least $150 million and create a minimum of 500 new jobs in Oregon by 2016.

Follow Matt Egan on Twitter @MattMEgan5