Grubhub's average daily orders jumped 32% in the second quarter as the pandemic shut in diners, but the company swung to a loss as it spent heavily to prop up struggling restaurants and protect drivers.

The Chicago-based restaurant delivery company lost $45 million in the April-June period, down from a profit of $1.3 million in the same period a year ago. Adjusted for one-time items, the company lost 17 cents per share, which was in line with Wall Street’s expectations, according to analysts polled by FactSet.

The earnings report is one of Grubhub’s last as a standalone company. Grubhub announced a $7.3 billion merger with Just Eat Takeaway.com last month. The deal is expected to close in the first quarter of 2021.

Grubhub Inc. said second-quarter revenue jumped 41% to $459 million as more diners chose to get delivery. That far surpassed analysts’ forecast of $405 million in revenue.

Grubhub said it had 27.5 million active diners in the April-June period, a 35% increase from a year ago. Average daily orders jumped 32% to 647,100, also surpassing Wall Street's forecasts.

More restaurants also joined the platform in an effort to reach diners. Grubhub said it saw a net increase of 25,000 partner restaurants from early May, including fast food chains like Burger King and Chipotle.

The company said it continues to see strong growth heading into the third quarter.

“We now believe the pandemic has been less of a temporary demand spike and more of a permanent catalyst, putting our business on a higher, sustained trajectory,” Grubhub said in a letter to investors.

Grubhub shares rose 1% to $71.08 in morning trading Thursday.

But the coronavirus has also added significant costs. Grubhub founder and CEO Matt Maloney said the company spent $100 million in the second quarter on coronavirus-related items, including $85 million in reduced diner fees, coupons and and increased advertising and $15 million to send 250,000 personal protection kits to drivers.

The virus has also hurt Grubhub's business in New York, one of its biggest markets. The company said order growth is up slightly in some parts of the city and the suburbs, but Manhattan continues to be a drag on the business.

Grubhub didn't issue any guidance, citing the acquisition by Amsterdam-based Just Eat Takeaway.com.

The combination will create one of the world’s largest meal delivery companies. Together, Grubhub and Just Eat Takeaway have around 70 million users. Last year the two companies processed 593 million restaurant orders.

Uber had also expressed interest in combining Grubhub with Uber Eats, its restaurant delivery business. But after Just Eat Takeaway grabbed Grubhub, Uber snatched up Postmates in a $2.65 billion deal announced earlier this month.