Walgreens Boots Alliance has agreed a $6.5bn (£4.8bn) deal to sell its Alliance Healthcare wholesale business in order to focus on its retail operations.

The parent company for Boots confirmed that pharmaceutical wholesaler AmerisourceBergen will acquire the majority stake of the business for $6.28bn (£4.62bn) in cash and 2 million AmerisourceBergen shares.

In addition, the two companies have struck a commercial partnership, which will extend their US distribution deal by three years to 2029.

Alliance Healthcare UK, which is responsible for distributing medicines from sites in Beeston, Nottinghamshire, and Weybridge, Surrey, will also continue to act as a distribution partner until 2031, despite the sale.

Walgreens Boots Alliance said that it hopes the sale will allow it to focus on expanding its core retail pharmacy businesses.

Executive vice-chairman and chief executive Stefano Pessina said: “This strategic agreement with AmerisourceBergen, which we consider to be the world’s leading pharmaceutical wholesaler, is a very positive development for the two companies.

“This deal will enable significant value creation for both companies and will generate new synergies in addition to those already captured. It is a logical step following the success of our long-term strategic relationship with AmerisourceBergen, which has been a strong and trusted partner since 2013.

“The transaction will fuel higher future investments to grow and transform our core retail pharmacy and healthcare businesses, and is EPS [earnings per share] accretive long-term for Walgreens Boots Alliance.”

AmerisourceBergen chairman, president and chief executive Steven Collis added: “AmerisourceBergen’s vital role in the health system as a key pillar of pharmaceutical innovation and access has been on full display over the past year.

“AmerisourceBergen’s financial and strategic position enables this next evolution of enhancing our ability to provide healthcare capabilities across regions and deliver innovative solutions for our upstream and downstream partners.

”Today’s announcements will expand our reach and solutions in pharmaceutical distribution and add to AmerisourceBergen’s breadth and depth of global manufacturer services, supporting our ability to create differentiated value for all our stakeholders.

“I look forward to extending and expanding our successful partnership with Walgreens Boots Alliance and welcoming the industry-leading team at Alliance Healthcare to AmerisourceBergen.”