Take the latest VB Survey to share how your company is implementing AI today.

(Reuters) — European food-ordering firm Just Eat Takeaway said on Wednesday it had agreed to buy U.S. peer Grubhub in an all-stock deal that, if completed, would create the world’s largest food delivery company outside China.

The deal would create “a company built around four of the world’s largest profit pools in food delivery: the U.S., the U.K., the Netherlands, and Germany,” the companies said in a joint statement.

For Grubhub, the deal offers an escape from the antitrust concerns that plagued its talks with the Uber Eats division of ride-hailing firm Uber.

Uber approached Chicago-based Grubhub in May for an all-stock deal that fell apart this week. In a statement, Uber said the food delivery industry needs consolidation, but “that doesn’t mean we are interested in doing any deal, at any price, with any player.”

Media reports about the Uber offer prompted Just Eat Takeaway to reach out with its own offer, Grubhub CEO Matt Maloney told Reuters in a phone interview.

Just Eat only recently acquired Takeaway, in January, for $7.8 billion.

Maloney has known Just Eat Takeaway’s billionaire CEO Jitse Groen since 2007, and the companies have similar models as marketplaces for customers to find restaurants and order from them, Maloney said.

The European firm presented an offer “at a price that made the decision very easy,” Maloney said. The deal also provides Grubhub “financial strength and flexibility.”

Grubhub’s stock price rose nearly 6% in aftermarket trading and Just Eat Takeaway shares closed more than 13% lower in Amsterdam after the companies disclosed they were in talks in the late afternoon.

Experts say consolidation is long overdue in the U.S. restaurant delivery sector, where demand is surging, especially as many people stay home to combat the spread of the novel coronavirus.

Just Eat Takeaway said it expects to close the deal in the first quarter of 2021, pending shareholder and regulatory approval.

Chris Sagers, who teaches at Ohio’s Cleveland-Marshall College of Law, said a deal between Grubhub and Just Eat Takeaway should win easy approval from U.S. antitrust enforcers.

The combined company will be headquartered in Amsterdam.

The companies said in a presentation that Just Eat Takeaway had 2019 revenues of 1.5 billion euros ($1.7 billion), compared with Grubhub’s 1.2 billion euros.

In a trading update, the companies said that order growth was up 41% across the companies’ main markets in April and May, as the coronavirus outbreak led to a surge in use of online food services.

Groen founded Takeaway in 2000 while still a student and oversaw its growth through a series of acquisitions, including a 2018 deal to buy the German operations of rival Delivery Hero.

Groen already owns a 10.29% stake in Just Eat Takeaway.

(Reporting by Toby Sterling and Greg Roumeliotis; additional reporting by Diane Bartz in Washington, Paul Sandle in London, and Krystal Hu in New York;.Writing by Hilary Russ, editing by Jonathan Oatis, Rosalba O’Brien, and Cynthia Osterman.)