By Dave Sebastian

Shares of Uber Technologies Inc. rose 5.4%, to $32.33, after the company said it has agreed to buy Postmates Inc. for about $2.65 billion in an all-stock deal, the latest in a flurry of consolidation moves in the food-delivery sector.

The combination boosts Uber Eats, the company's food-delivery arm that already has an international footprint and is among the largest in the U.S. DoorDash has the largest share of the U.S. food-delivery market, according to research from Edison Trends.

Uber said it will keep the Postmates app running separately after the deal's closing, expected in the first quarter of 2021. Postmates, founded in 2011 and based in San Francisco, is the smallest among the major U.S. food-delivery companies.

The deal comes after Uber's failed bid to buy Grubhub Inc. as the ride-hailing giant seeks surer footing amid the Covid-19 pandemic, which has crushed its rides business. There were also regulatory concerns that a combination with Uber would create a monopoly in New York City. Grubhub last month agreed to be bought by Dutch food-delivery giant Just Eat Takeaway.com NV for more than $7 billion.

Postmates can complement Uber's services with its stronghold in Los Angeles, Las Vegas and San Diego, KeyBanc Capital Markets said.

"Customers will have access to a larger selection of restaurants, and for restaurants, the combined company will offer more tools and technology to cost-effectively connect with a larger customer base," KeyBanc said.

Write to Dave Sebastian at dave.sebastian@wsj.com