The largest retail pharmacy chain in the U.S., Walgreen (WBA 3.69%) has outperformed the S&P 500 by a wide margin over the past twelve months. The stock popped in February following the announcement of a 3.7% year over year rise in January sales.

The good times kept rolling when the company released its first quarter results; sales reached a record high $19.6 billion for a gain of 5.1% year over year, total sales in comparable stores rose 4.3%. Let's take a look at what's driving this impressive growth, and see if it can continue.

WAG Total Return Price Chart

WAG Total Return Price data by YCharts

Promoting synergy
With over 8,000 locations in the U.S., there's only so much more room to grow domestically. Not quite two years ago Walgreen expanded its international presence with a 45% stake in Alliance Boots. The pharmacy chain is the largest throughout the EU with over 3,000 stores, and it is rapidly expanding into the Chinese market. So far, the partnership is shaping up to be as profitable as hoped.

Acquisition-related synergies are growing quickly. During the twelve months ending August 31, 2013, net synergies reached $154 million. In just the first half of fiscal 2014, that figure exploded to a whopping $236 million  .

At the outset of the merger, management forecasted annual synergies of roughly $1 billion annually within four years. So far the company is on pace to blast through that target. Less than two years following the deal, Walgreen's twelve-month EBITDA margin is sitting on a 10-year high. If the cost cutting benefits of the merger continue to grow, they will go a long way toward expanding the company's bottom line.

Tax inversion
If some of Walgreen's investors have their way, benefits of the merger will go far beyond combining talent and eliminating redundancies. Recently a group of shareholders representing about 5% of the company lobbied management to relocate its headquarters and avoid one of the world's highest corporate tax rates.

Walgreen's effective tax rate was 34.9% in the last quarter. Alliance Boots pays roughly 20%. Relocating outside of the US won't help Walgreen win any popularity contests, but it would add a great deal to the company's bottom line.

Positive feedback loop
Just over a year ago Walgreen and Alliance Boots entered a 10-year pharmaceutical distribution agreement with AmerisourceBergen (NYSE: ABC). Now the distributor can leverage the immense weight of its partners to source branded and generic products. Those savings pass through to Walgreen as AmerisourceBergen now distributes all of its branded drugs and soon all its generics.

With those lower priced drugs, Walgreen can keep the nearly 80 million active members in its loyalty program happy while remaining profitable. As its customer base grows, AmerisourceBergen can hopefully negotiate progressively better deals with pharmaceutical manufacturers.

Just one year into the agreement, Walgreen's gross margin hasn't reflected the benefits. If the company uses its advantage to lure customers away from competitors with lower prices, you might not see the margin expansion in years ahead either. Keep your eyes open for shrinking margins at smaller competitors like Rite Aid going forward.

Not a follower
While Walgreen did an excellent job of expanding through the Alliance Boots deal, it missed a great chance for gaining some free publicity. CVS Caremark was bathed in positive mentions for a week after announcing it will stop selling tobacco later this year. While CVS is likely to lose $2 billion in annual sales from tobacco, it could make up the difference with its smoking cessation program. Walgreen, on the other hand, might continue selling tobacco products in its stores, but it will begin helping customers to quit smoking online. In a partnership with GlaxoSmithKline's Consumer Healthcare unit, Walgreen launched the Sponsorship to Quit program. As you can imagine, the program offers recommendations for Glaxo's smoking cessation products, available for purchase at Walgreen.

A Fool looks ahead
There's a lot for long-term growth investors to like about Walgreen. The international expansion opportunities Alliance Boots provides are just what it needs to maintain earnings growth for years to come. Lower taxes from a relocation could provide an additional boost, but fear of political backlash could also prevent it from happening any time soon.

Looking further ahead, the competitive advantage created through collaboration with Alliance Boots and AmerisourceBergen could make this a stock to hold onto for the long term.