(Adds details on revenue per package, context)
By Lisa Baertlein and Arunima Banerjee
July 25 (Reuters) - United Parcel Service Inc's second-quarter profit topped Wall Street's estimate on Wednesday, after online shipments for customers such as Amazon.com and Walmart Inc boosted package volumes in its core U.S. business.
Shares rose 4 percent to $116.95 in late morning trading on the New York Stock Exchange after the world's biggest package delivery company also reaffirmed its full-year profit and capital spending forecasts.
Revenue at the company's U.S. package services rose 6.3 percent versus a year ago, driven by e-commerce demand and price increases that analysts said grew at the highest rate in almost seven years.
The rapid rise in online shopping has been a boon for so-called "last-mile" shipping in the United States, and UPS is fighting to protect its industry-leading margins from the higher costs of delivering e-commerce parcels to individual households.
UPS Chief Executive David Abney is pumping billions of dollars into network upgrades and expansions to handle the growth from e-commerce, and he is under pressure from some analysts and investors who want faster returns on those investments.
"The domestic segment showed less progress turning the corner on profitability than we had bullishly expected," Bernstein analyst David Vernon said in a client note.
In a telephone interview, Abney said UPS "made a lot of progress during the quarter. We also acknowledge that there is continued work to be done."
UPS net income was up 7.3 percent to $1.49 billion, or $1.71 per share, for the second quarter.
On an adjusted basis, the company earned $1.94 per share, beating analysts' estimate by a penny per share, according to Thomson Reuters I/B/E/S.
U.S. domestic packaging operating profit fell to 9.1 percent during the quarter, from 12.9 percent a year ago, as planned increases in pension expenses and costs for ongoing network projects weighed on results.
Total revenue rose a better-than-expected 9.6 percent to $17.46 billion, as pricing and demand remained strong.
International package segment revenue jumped 13.6 percent, while supply chain and freight revenue increased 16 percent.
UPS maintained its forecast for full-year adjusted earnings of $7.03 to $7.37 per share and said it still plans to spend between $6.5 billion to $7 billion on network improvements in 2018.
On Tuesday, UPS said it expects annual savings of around $200 million from employee buyouts. Because those departures will be staggered over the coming year, the full impact of the savings won't come until the second quarter of 2019. (Reporting Lisa Baertlein in Los Angeles and Arunima Banerjee in Bengaluru; Editing by Maju Samuel and Jonathan Oatis)