By Cara Lombardo, Dana Cimilluca and Ben Dummett

Grubhub Inc. agreed to combine with Europe's Just Eat Takeaway.com NV, turning its back on Uber Technologies Inc. in a surprising twist in the scramble for mergers among food-delivery companies.

The move would create a trans-Atlantic food-delivery giant at a time when industry players are seeking scale to help them cope with a landscape that includes booming demand but also fierce competition.

Grubhub and Just Eat, which is based in the Netherlands, said late Wednesday they plan to combine in all-stock deal, confirming an earlier report by The Wall Street Journal. Grubhub shareholders would receive 0.6710 Just Eat share for each Grubhub share, now worth just over $65 after a decline in Just Eat shares Wednesday.

Based on Tuesday's closing price, the deal values Grubhub at $7.3 billion.

Uber and Grubhub had been negotiating a combination for weeks, but the talks got bogged down over antitrust issues and Uber was already considering pulling the plug, according to people familiar with the matter.

Uber said in a statement that the food-delivery industry will need to consolidate to reach its potential for consumers and restaurants. "That doesn't mean we are interested in doing any deal, at any price, with any player," it added.

Just Eat Takeaway was created earlier this year through the $11.1 billion merger of the U.K.'s Just Eat and Netherlands-based Takeaway.com. It brought together one of the biggest food-delivery companies in the U.K. with Takeaway.com, which had a big presence in continental Europe.

Given that Just Eat doesn't have a presence in the U.S., the risk that regulators will seek to block the deal or require significant divestitures is seen as lower than it would be in the case of a tie-up between Grubhub and Uber. But striking a trans-Atlantic deal using stock as currency will bring its own set of complications, and the transaction will require signoff from both sets of shareholders.

In a sign Just Eat may have work to do selling its own shareholders on the merits, the company's American depositary receipts dropped more than 10% on news of the talks. Uber's shares closed down roughly 5% Wednesday and Grubhub's rose 2%.

The tie-up is unlikely to diminish the intense competition in the U.S. meal-delivery industry, which has grown as newer entrants such as DoorDash Inc. grab market share with discounts and promotions. For Uber, it would create a more formidable global competitor, the largest outside of China, Grubhub and Just Eat said. Consolidation has been expected and the need became more pressing as the pandemic unleashed a torrent of demand.

Grubhub, which went public in 2014 and operates other brands including Seamless, was the leader in the industry and the only major U.S. player to turn a profit. But its margins came under pressure in the past year as it spent to ward off competition, and DoorDash is now No. 1 in the U.S. market.

In January, Just Eat Chief Executive Jitse Groen called his Grubhub counterpart, founder Matt Maloney, to broach the possibility of a deal but didn't submit a bid until the Uber discussions were under way in May, some of the people said. Another European rival, Delivery Hero SE, also considered a bid but decided against it.

Mr. Maloney, who has been negotiating a sale from his Michigan cabin, has been friendly with Mr. Groen, who founded Takeaway.com, and Uber CEO Dara Khosrowshahi for years.

Mr. Groen will remain CEO of the combined company, which is expected to be 30%-owned by Grubhub shareholders. Mr. Maloney will run its North America business and join its board.

Uber had approached Grubhub earlier in the year, but talks had fallen apart before the coronavirus dented demand for Uber's core ride-hailing business and added new impetus to its search for a deal. Demand for ride-hailing has since started to bounce back.

As soon as the potential deal with Uber became public, prominent politicians including Sen. Amy Klobuchar (D., Minn.) voiced concerns about its potential impact on customers and called on the Federal Trade Commission and Justice Department to initiate investigations should the companies decide to merge.

Other deals are unraveling as the pandemic upends business and roils financial markets, and the Grubhub-Just Eat agreement could signal more activity to come as shutdowns ease and companies re-examine their prospects.

Mall operator Simon Property Group Inc. on Wednesday sought to terminate a $3.6 billion agreement to buy Taubman Centers Inc. Private-equity firm Sycamore Partners last month scrapped a deal with Victoria's Secret parent L Brands Inc. to buy a majority stake in the lingerie chain.

Global deal volume is down roughly 47% so far this year, according to Dealogic.

Bank of America Corp. and Goldman Sachs Group Inc. advised Just Eat, while Evercore Inc. and Centerview Partners advised Grubhub.

Write to Cara Lombardo at cara.lombardo@wsj.com, Dana Cimilluca at dana.cimilluca@wsj.com and Ben Dummett at ben.dummett@wsj.com