(Reuters) - FedEx Corp confirmed on Wednesday it would terminate its contract with Amazon.com Inc for small-package ground deliveries, as the online retailer focuses on building out its own delivery network.

The move by the U.S. package delivery company comes two months after it decided not to renew its contract with Amazon for U.S. cargo delivery through its plane-based express service.

“This change is consistent with our strategy to focus on the broader e-commerce market,” FedEx said in a statement as it looks to expand and serve companies that would include rivals of Amazon.

Amazon in a statement said it is “constantly innovating to improve the carrier experience and sometimes that means reevaluating our carrier relationships.”

Shares of FedEx were down 2% at $157.91 and Amazon shares were down 1% at $1,769.25 at midday on Wednesday.

Amazon has been expanding its own delivery network of planes, trucks and vans and is regarded as a potential long-term threat to FedEx and rival United Parcel Service Inc, both of which have long counted the e-commerce company as a customer.

“What was a frenemy, they’ve now figured out is their competitor,” said Trip Miller, managing partner at Memphis-based Gullane Capital, referring to the FedEx relationship with Amazon.

Slideshow ( 3 images )

Analysts have said Amazon has secured a better rate with UPS for package deliveries on planes, so it makes little sense for the company to partner with FedEx.

Amazon accounted for less than 1.3% of FedEx’s revenue last year. UPS, which derives a relatively larger share of revenue from the online retailer, is widely expected to benefit from higher volumes following the latest move, according to analysts.

FedEx already warned in June that U.S.-China trade tensions and the termination of its contract with Amazon would hurt its fiscal 2020 performance.

Meanwhile, FedEx Ground is working to wring out more residential profit by shifting the delivery of nearly 2 million SmartPost packages from U.S. Postal Service mail carriers to its own drivers. That should lower costs by increasing the number of parcels dropped at every stop.

The news about FedEx terminating the Amazon ground delivery contract was first reported by Bloomberg.