Vehicle listings company CarGurus turned a profit in the second quarter as revenue tumbled during the coronavirus pandemic, reflecting discounted dealership subscriptions to its online marketplace.

The Cambridge, Mass., company on Thursday reported revenue of $94.7 million in the quarter ended June 30, down 35 percent from the same quarter a year earlier. Subscription revenue generated by its listings marketplace fell 38 percent to $80 million — $75.5 million of that in the U.S. — while advertising and other revenue fell 7 percent to $14.8 million.

The company reported a 43 percent drop in operating expenses, driven by steep declines in sales and marketing expenses, and said net income rose 19 percent to $7.1 million.

“Although our industry and our business are facing unprecedented uncertainty amidst the COVID-19 pandemic, CarGurus generated strong results in the second quarter that demonstrate our business’s flexibility and resilience,” CEO Langley Steinert said in a statement. “Our business showed several signs of recovery in the second quarter as consumer demand increased significantly in May and June, yielding strong lead generation and helping dealers rebuild their sales pipelines.”

CarGurus shares rose 3.6 percent in after-hours trading Thursday.

The pandemic’s impact on auto dealerships has had widespread ripple effects on technology vendors. To accommodate dealerships that had to close showrooms this spring and saw slower sales and service traffic because of state and local stay-at-home orders, CarGurus reduced listings subscription fees. U.S. paying dealership customers had their fees reduced by 50 percent in April and May and 20 percent in June.

The company in April said it would lay off 13 percent of its global work force and end operations in Germany, Italy and Spain.

CarGurus lost paying dealership subscribers during the pandemic as retailers pulled back on marketing outlays. As of June 30, the company reported having 23,806 U.S. dealership customers, down from 25,723 as of March 31 and 26,289 as of December. The company said it recently redefined a paying dealer as one “with an active, paid marketplace subscription at the end of a defined period.”

The company said the cancellation trend stabilized in May. A rebound in website traffic and leads generated “a substantial re-acquisition of business in the last two months of the quarter.” Steinert said the company more broadly introduced a new marketing product suite and saw record levels of engagement with its customer financing tool in the second quarter.

CarGurus on Thursday issued revised revenue guidance for the full 2020 fiscal year, with expectations from $518 million to $524 million. That is down from earlier revenue projections of $664 million to $676 million at the end of its 2019 fiscal year.