Merck (MRK -0.13%) is known today as a pharmaceuticals industry leader with a market cap of over $170 billion and a solid dividend. But the stock didn't always claim the value that it does today. Through acquisitions, mergers, and nine stock splits along the way, the history of Merck stock has a lot of twists and turns.

Here's a brief look at how Merck got to where it stands today as one of the top pharmaceutical stocks in the world -- from boom to bust to bouncing back.

Merck headquarters

Image source: Merck. 

Historic roots

Merck's history dates all the way back to 1668, when Friedrich Jacob Merck bought an apothecary in Darmstadt, Germany. In 1827, Heinrich Merck transformed the company into a drugmaker. The company's American roots began in 1887, when a U.S. sales office was opened by E. Merck AG. 

The modern Merck that we know came into existence in 1917. When the U.S. entered World War I, the American business separated from its German parent. The company became known as Merck & Co. in the U.S., although E. Merck AG retained the rights to the Merck name outside of the U.S. 

Modern boom years

Merck stock entered into a stretch of remarkable gains beginning in the mid-1980s. This winning streak extended into the end of the 20th century, with a few pullbacks along the way, most of them relatively short.

MRK Chart

MRK data by YCharts.

Highlights of this boom period included the launch of congestive heart failure drug Vasotec in 1985. By 1988, Vasotec had become Merck's first drug to achieve annual sales of $1 billion. The company introduced cholesterol drug Zocor in 1992, which also went on to become a blockbuster for Merck. 

A couple of significant acquisitions and divestitures occurred during the period as well. In 1993, Merck bought drug distributor Medco. A few years later, in 1999, the company sold off its specialty chemicals businesses. 

From boom to bust

Between 1985 and 2000, Merck stock soared more than 3,500%. Those tremendous gains didn't hold entirely, though. In the following decade, Merck's share price collapsed.

MRK Chart

MRK data by YCharts.

Part of the problem was a decline in the overall market in the early 21st century following the bursting of the dot-com bubble. However, Merck also had its own unique challenges. Four of its top-selling drugs lost patent exclusivity in 2000 and 2001. 

Even worse, Merck had to withdraw blockbuster arthritis drug Vioxx from the market in 2004 after studies found that the drug doubled the risk of heart attacks and strokes in long-term users. Merck stock cratered 27% on the day of the Vioxx announcement. 

It was during this period (in 2003) that Merck spun off Medco as a separate company. Medco was eventually bought by Express Scripts in 2012 for $29.1 billion -- more than the entire market cap of Merck up until 1990.

Merck also had some developments in the first decade of the new century that set the stage for an improved future. In 2006, diabetes drug Januvia won U.S. regulatory approval. That same year, HPV vaccine Gardasil gained approval. Both products would go on to become huge winners for Merck. And in 2009, Merck merged with Schering-Plough.

Bouncing back

When Merck acquired Schering-Plough, the crown jewels it inherited included international rights to autoimmune disease drugs Remicade and Simponi. However, Johnson & Johnson (JNJ 0.04%) thought the merger constituted a change of control that allowed it to take back ex-U.S. rights to the two drugs. 

The two companies agreed on a settlement in 2011 that allowed Merck to keep marketing the drugs in most of the territories that Schering-Plough held. Remicade and Simponi contributed to Merck's reversal of fortunes beginning in 2010.

MRK Chart

MRK data by YCharts.

A little-known drug called pembrolizumab was also included in the pipeline that Merck gained with the Schering-Plough merger. Schering-Plough had taken ownership of pembrolizumab when it bought Organon in 2007. The drug is now known as Keytruda. 

Keytruda is the centerpiece of Merck's latest resurgence. The drug won approval in 2014 for treating advanced melanoma. In 2015, the FDA approved Keytruda as a second-line treatment of non-small cell lung cancer. Last year, the drug gained approval for treating head and neck cancer plus the biggest prize of all -- first-line treatment of lung cancer. More recently, in March 2017, the FDA granted approval to Keytruda for treating classical Hodgkin lymphoma. 

Analysts think Keytruda should reach peak annual sales of close to $8 billion. The potential for the drug has helped Merck stock climb nearly 20% since the beginning of 2016. 

Merck's pipeline could help boost the stock more down the road. The company claims 12 drugs in addition to Keytruda that are in late-stage clinical studies. After a history spanning nearly 350 years, the story of Merck stock has a long way to go.