Target has acquired San Francisco-based transportation technology company Grand Junction, in order to help it move more quickly into the business of same-day delivery. The company had already been working with Target on a same-day delivery pilot program in New Yorks Tribeca neighborhood, prior to this deal. That pilot will expand this fall to more New York area stores before a broader rollout to other large metros starting next year.

The retailer had already dipped its toe in the water of on-demand, local delivery. It has tested same-day delivery in 2014, and later in partnership with Instacart. And this May it announced its plans for Target Restock, a next-day delivery service focused on everyday essentials, like household items, personal care products and other dry goods similar to those you can order through Amazon Prime Pantry.

The Restock service had been in testing with staff at Targets headquarters before expanding to a consumer-facing pilot with customers in the Minneapolis-St. Paul area, where Target is based.

Around the same time, Target also announced a small test of same-day delivery in New York. The pilot allowed guests shopping the Tribeca location to have their in-store purchases delivered anywhere in Manhattan, and to parts of Brooklyn or Queens. This eliminated the need for customers to haul their heavier purchases home themselves, or on public transit.

Grand Junctions technology was used in this NY area test, Target says.

The company offersa software platform thats used by retailers, distributors and third-party logistics providers to manage local deliveries through a network of more than 700 carriers. The software helps to determine the most efficient, fastest route for a local delivery, while also tracking deliveries and giving the retailer an overview of carrier performance.

By bringing this technology in-house, Target says it will be able to offer same-day delivery in more areas, as well as assembly and installation services. Potentially, this could be used to speed up Target Restock from a next-day to a same-day delivery service, as well.

However, the deal is about more than just same-day, Target says. That includes all last-mile logistics needs, from regular online orders to same-day or next-day from stores.

With the acquisition, Target gains immediate access to Grand Junctions technology and carrier network, which will allow it to more quickly move into same-day delivery. Grand Junctions 13 employees will become a part of Targets technology team in San Francisco, where theyll best tasked with expanding the New York area pilot this year, ahead of a wider same-day delivery service rollout next year.

Grand Junctions technology and algorithms will help Target deliver to guests faster and more efficiently, said Arthur Valdez, executive vice president, chief supply chain and logistics officer, Target, in statement. This acquisition is part of Targets ongoing efforts to strengthen Targets supply chain to provide greater speed, reliability and convenience for guests.

Above: Targets next-day delivery service, Restock

Same-day delivery is an area where theres an increasing amount of competition. Amazon today offers Prime Now in over 30 U.S. markets, promising 2-hour delivery of thousands of items. A good handful of same-day grocery delivery services are also gaining steam, including Instacart, Shipt, Peapod and others. Theres also Postmates for restaurant and general product delivery. And Uber is figuring out how to leverage its technology for than just moving more than people.

Meanwhile, Walmart has doubled down on a same-day pickup service for groceries, and even incentivized customers with discounts when online customers chose to ship items to the store for pickup instead of delivery. Walmart has also taken on Amazon with a free 2-day shipping service and has begun testing using store staff for last mile deliveries.

Lastly,startups like Curbside are working with major companies like CVS, Pizza Hut and Yelp, to expand access to same-day pickup services, too. (Target hadalso worked with Curbside before.)

Target is seizing a tremendous opportunity to leverage local delivery as a retail differentiator, said Rob Howard, Grand Junctions founder and CEO, who will become a vice president of technology at Target, as a result of this deal. Were thrilled about helping to pursue this opportunity, and to join Target at this unprecedented time in retail.

The move could help Target retain its footing as more brick-and-mortar stores face waning foot traffic and store closures. Targets online sales have been improving, having rose 22 percent in the last quarter, but it still faces huge threats from Amazon and Walmart in this area. Thats especially true when it comes to groceries something thats been made worse by Amazons acquisition of Whole Foods. However, Target recentlyboosted its Q2 earnings forecast due to an expected increase incomparable-store sales.

Read more: