AMSTERDAM — Just Eat has agreed to buy Grubhub for $7.3 billion.

The European food delivery company entered into a definitive agreement to acquire 100% of the shares of Grubhub in an all-stock transaction. Combined, the two companies will create the largest online food delivery service outside of China, measured by gross merchandise value and revenues.

The announcement comes after several weeks of negotiations between Uber and Grubhub over a potential combination. Uber has expressed a need for consolidation in the food delivery space but also said “that doesn’t mean we are interested in doing any deal, at any price, with any player.”

Grubhub went public in 2014 and was the No. 1 food delivery service in the United States for several years. Growing competition has weighed on the company recently, with Matt Maloney, chief executive officer at Grubhub, citing “promiscuous diners” using more than one delivery app as a major challenge.

The deal builds on the recent $11 billion merger of UK-based Just Eat PLC and The Netherlands-based It represents the company’s entry into the US food delivery market and expands its existing presence in North America through the Canadian business SkipTheDishes.

“Matt and I are the two remaining food delivery veterans in the sector, having started our respective businesses at the turn of the century, albeit on two different continents,” said Jitse Groen, CEO and founder of Just Eat “Both of us have a firm belief that only businesses with high-quality and profitable growth will sustain in our sector. I am excited that we can create the world’s largest food delivery business outside China. We look forward to welcoming Matt and his team to our company and working with them in the future.”

Maloney will run the combined company’s North American business and join its board.

“I’ve known Jitse since 2007 and his story is much like mine,” he said. “Combining the companies that started it all will mean that two trailblazing startups have become a clear global leader. We share a focus on a hybrid model that places extra value on volume at independent restaurants, driving profitable growth. Supported by Just Eat, we intend to accelerate our mission to be the fastest, best and most rewarding way to order food from your favorite local restaurants in North America and around the world.”