Uber Technologies Inc. has agreed to acquire Postmates Inc. in a $2.65 billion all-stock takeover.

Uber Eats head Pierre-Dimitri Gore-Coty is expected to continue to run Uber’s combined delivery business, according to Bloomberg News. Under their agreement, Postmates Chief Executive Officer Bastian Lehmann and his team will stay on to manage Postmates as a separate service, another person said.

The takeover would help Uber gain ground against privately-held DoorDash Inc., the current market leader in U.S. food delivery. While Postmates hasn’t kept pace with DoorDash, it maintains a strong position in Los Angeles and the American Southwest, both of which could be valuable to Uber Eats.

Representatives for Uber and Postmates declined to comment.

Uber and Postmates had held discussions on and off for about four years but the talks accelerated about a week ago after Uber approached the latter firm, one of the people said. The move for Postmates comes on the heels of Uber’s failed bid to acquire publicly traded GrubHub Inc., which was scooped up by Europe’s Just Eat Takeaway.com NV for $7.3 billion. Uber’s board of directors has approved the deal, a person said, though the plans could still be subject to change.

Founded in 2011, Postmates was one of the first to let customers in the U.S. order meal delivery using a mobile app. However, competition has intensified in recent years and Postmates has fallen to a distant fourth. The company said in February 2019 that it had filed paperwork confidentially for an initial public offering but never went public. It raised private capital last year in a deal that valued the business at $2.4 billion.