By Cara Lombardo, Dana Cimilluca and Ben Dummett

Grubhub Inc. is nearing a deal 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, are working on an all-stock deal that could be completed as early as Wednesday, according to people familiar with the matter. The deal would value Grubhub at roughly $70 a share, some of the people said, a premium to its trading price of about $57 Wednesday afternoon. Just Eat confirmed in a statement Wednesday that it is in advanced discussions with Grubhub about an all-stock combination, confirming an earlier report by The Wall Street Journal.

Uber and Grubhub had been negotiating a combination for weeks but the talks got bogged down over issues including who would shoulder the risk authorities would block it on antitrust grounds or delay its close, and Uber was already considering pulling the plug, some of the people said.

Should Grubhub and Just Eat strike a deal, it would be the second major combination in the industry so far this year.

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.

Grubhub had a market value of roughly $5.3 billion as of Tuesday's close, while Just Eat's was around EUR14.6 billion ($16 billion).

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 is expected to 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 were down roughly 3% Wednesday afternoon, with Grubhub's falling about 2% as investors registered disappointment that the parties failed to reach agreement.

Competition in the U.S. meal-delivery industry has been intense as newer entrants such as DoorDash Inc. grab market share with discounts and promotions. 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 also operates other brands including Seamless, was the leader in the industry and the only major 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 the largest player in the U.S. market.

DoorDash and Uber are both backed by Japanese technology conglomerate SoftBank Group Corp. DoorDash and another player, Postmates Inc., both filed to go public earlier in the year.

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. In addition to its food-delivery business, Uber Eats, Uber has a big ride-hailing operation that has been hobbled by stay-at-home orders occasioned by the coronavirus pandemic but is beginning to bounce back.

The companies had agreed on a price of roughly 1.925 Uber shares for each Grubhub share and had estimated potential cost savings could top $300 million, according to people familiar with the matter. At previous prices, that would have valued Grubhub at around $70 a share.

But as soon as talks became public in mid-May, the potential tie-up was plagued by concerns that antitrust regulators would try to block the deal or require significant divestitures. Prominent politicians including Sen. Amy Klobuchar (D., Minn.) voiced concerns about the impact of decreased competition on customers and called on the Federal Trade Commission and Justice Department to initiate investigations should the companies decide to merge.

The Journal reported in May that Just Eat and another European player, Delivery Hero SE, were considering a bid for Grubhub but were unlikely to jump into the fray while a deal was still Uber's to lose.

The potential merger is a rare move toward consolidation at a time when other deals are unraveling as the pandemic upends business and roils financial markets, and it 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., arguing that its smaller rival had breached deal terms by failing to adequately cut costs in response to widespread shopping-center closures. 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.

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