FedEx Corp. said it was ending its contract to deliver Amazon.com Inc. packages through its ground network, essentially severing ties with one of the world’s biggest shippers and gambling it is better off filling its trucks with other customers’ goods.

The delivery giant said Wednesday it decided not to renew the contract when it expires at the end of August. In June, FedEx said it was ending its air-shipping contract with Amazon in the U.S. but would continue to handle ground deliveries. FedEx would still handle international...