New York (CNN Business) On-demand food delivery startup DoorDash has agreed to acquire rival Caviar for $410 million.

Caviar, the premium restaurant delivery service, was most recently owned by payments-services company Square, which bought the firm in 2014 for about $90 million when it was just an early-stage startup.

"We have long-admired Caviar, which has a coveted brand, an exceptional portfolio of premium restaurants and leading technology," said DoorDash CEO Tony Xu in a statement. Xu notes that the deal "enhances the breadth of our merchant selection," giving customers more choices.

DoorDash raised $600 million in new financing in May, valuing the company at $12.6 billion, Xu has said . The on-demand food delivery space is fiercely competitive and DoorDash has emerged as the US leader when it comes to sales, surpassing Grubhub for the first time in May, according to analytics firm Second Measure.

According to Square's release, the cash-and-stock deal — which is expected to close later this year — builds on the existing partnership between DoorDash and Square for Restaurants. Square for Restaurants is a software platform designed to help small businesses integrate online delivery orders with in-restaurant operations. The product was introduced last year.

Read More