AmerisourceBergen shares rose 15.7 percent in after-hours trading and shares of Walgreens, which has around 13,000 drugstores worldwide, mostly in the United States, were unchanged.

Walgreens is valued at $67.82 billion and AmerisourceBergen has a market capitalization of $19.65 billion, according to Thomson Reuters data.

Healthcare payers and pharmacies are responding to a shifting landscape, including changes in the U.S. Affordable Care Act, rising drug prices and the threat of competition from online retailers such as Amazon.com Inc.

A new deal by Walgreens would follow the $69 billion acquisition of health insurer Aetna Inc by drugstore rival CVS Health Corp and would also reflect a move toward vertical consolidation, where members of a supply chain combine.

Representatives of Walgreens' Chief Executive Stefano Pessina made "a high-level outreach" to representatives of AmerisourceBergen CEO Steven Collis several weeks ago, the WSJ said, citing people familiar with the matter. (http://on.wsj.com/2Ch5Gg9)

AmerisourceBergen said it did not discuss potential mergers or acquisitions. Walgreens was not available for comment.

The two companies are already closely allied, having struck a 10-year deal in 2013 for AmerisourceBergen to buy drugs for Walgreens, which subsequently acquired 26 percent of the distributor.

Walgreens would buy the remaining shares under the deal being considered, the Journal reported. An offer has not been made, and there may be no deal, it added.

The drugstore operator last year represented 30 percent of AmerisourceBergen's revenue and is its largest customer.

Walgreens reported in January its sixth straight quarterly fall in retail same-store sales in the first quarter of fiscal 2018 along with a drop in gross margins in its U.S. business.

AmerisourceBergen reported last week a threefold jump in quarterly profit to $861.9 million, helped by a $587.6 million tax benefit.

Leerink analyst Ana Gupte said the Walgreens-AmerisourceBergen deal would be "poised to improve the profitability of the drug store giant through purchasing power with generics and branded drug manufacturers."

The CVS-Aetna deal was seen pressuring rival insurers, drugmakers, pharmaceutical benefits managers and retail pharmacies to consider mergers or switching partners to try to keep up with the potential healthcare cost savings or increase in profit margins.

Evercore analysts said Walgreens could fund all or a majority of the transaction via debt, likely making the financial returns notably attractive.

Walgreens shares have fallen 17.8 percent in the past 12 months, while AmerisourceBergen shares are down 1.9 percent in the same period.

CEO Pessina drove the Walgreens-Boots Alliance deal and more recently agreed to acquire 1,932 stores from smaller U.S. rival Rite Aid, partly in a bid to improve its ability to negotiate for lower drug costs.

(Reporting by Ismail Shakil and Rishika Chatterjee in Bengaluru; Additional reporting by Peter Henderson in San Franciso, Caroline Humer in New York and Bhanu Pratap in Bangalore; Editing by Peter Cooney and Lisa Shumaker and Amrutha Gayathri)

By Ismail Shakil and Rishika Chatterjee

Stocks treated in this article : AmerisourceBergen, Walgreens Boots Alliance