The health wearables company Fitbit today announced its first quarterly earnings since it went public in June, and the results are surprisingly good.

The company reported earnings of 21 cents per share for the second quarter ended in June, while analysts had expected earnings of just 8 cents. Analysts had expected revenues of $139 million, but Fitbit delivered $400 million.

Fitbit reported $18.3 million in profits for last year’s second quarter, and reported profits of $51.3 million in this year’s.

The San Francisco-based company also reported selling 4.5 million health devices in the quarter, the vast majority of them fitness trackers.

Many of the unit sales were likely made up of Fitbit’s Charge HR wearable, a fitness and heart-rate tracking wristband. Analysts say that Fitbit ramped up production of the device in the quarter, which should fuel growth in future quarters. The new device launched earlier this year.

Some of the units sold may result from partnerships Fitbit has formed with large companies to distribute health devices as part of employee wellness programs.

Fitbit says it has entered into such agreements with Geico, Sutter Health, Transunion, Quicken Loans, and several financial institutions. Fitbit says it’s signed up 50 of the Fortune 500 companies to buy Fitbit devices for wellness programs.

“Our second quarter results included our highest quarterly revenue in the eight-year history of Fitbit,” said Fitbit CEO James Park in a statement. “In the quarter, we introduced new features and services, expanded brand awareness, increased global distribution and further penetrated the corporate wellness market.”

Fitbit is projecting revenue numbers between $335 million and $365 million for the third quarter, ending in September. It expects earnings of between 7 cents and 10 cents per share. However, Fitbit does not expect gross margins to improve very much, predicting margins of 47 percent to 48 percent in the third quarter.

Despite Fitbit’s strong numbers, the stock is down roughly 7 percent in after-hours trading today. This may have been caused by the one negative number in today’s earnings: Gross margins fell from 51 percent in last year’s second quarter to 47 percent in the current quarter. Fitbit CFO Bill Zerella said during a conference call with analysts that the company has not yet had time to reduce the production costs of its newer fitness trackers.

Fitbit currently controls more than 60 percent of the market share for fitness trackers. It identifies its chief competitors as Adidas, Garmin, Jawbone, Misfit, and Under Armour.

Fitbit is currently the target of two lawsuits from rival Jawbone — one for patent infringement, another for employee poaching and secret stealing. Fitbit said that it’s innocent of any charges and will fight the lawsuits vigorously.

Fitbit’s product line includes the Fitbit Surge, FitbitCharge HR, Fitbit Charge, Fitbit Flex, Fitbit Zip, and Fitbit One activity trackers, as well as the Aria Wi-Fi Smart Scale. The products are carried in more than 30,000 North American retail stores, Fitbit said, and in another 15,000 stores in 53 other countries.

Fitbit’s existing investors include Foundry Group, Qualcomm Ventures, Sapphire Ventures, Softbank Capital, SoftTech VC, and True Ventures.

The phrase “Apple Watch” was not used once in this article.