Shaken or stirred, the martini has long been a favorite but the origins of the drink are a bit fuzzy.
When it comes to classic cocktails, it’s hard to beat a martini. The drink has reached iconic status, probably thanks in part to James Bond, and has inspired an entire category of martini-like drinks containing a wide variety of liquors, juices and other ingredients. While recipes for drinks similar to the martini have been in bartenders guides that date back to the late 1800’s, the true identity of the originator is unclear.
There are several prominent theories on the origin of the martini. One says that it was first made in the city of Martinez, near San Francisco, in 1849. A gold miner who had just struck it rich stopped at a bar in Martinez and ordered champagne to celebrate. He was told that the bar didn’t have any and the bartender instead made him a cocktail that he claimed to be better, the Martinez Special. The drink was actually sweet and contained gin, vermouth, maraschino liqueur, bitters and a lemon slice. The miner loved the drink and ordered a round for everyone in the bar. According to the city of Martinez, this drink was the forerunner to the martini, which later evolved into the gin (sometimes vodka) and vermouth version that we know today, and the name was shortened for ease.
Another theory says that the drink evolved from the brand of sweet vermouth by Martini & Rossi, which was first produced in 1863. People who ordered a cocktail containing gin and vermouth would often ask for a “gin and Martini.” Yet another story says that the cocktail came from the Knickerbocker Hotel in New York City in the early 20th century. A bartender at the hotel named Martini di Arma di Taggia is said to have prepared a gin and vermouth based cocktail that was a favorite of John D. Rockefeller.
We will probably never know the true origin of the martini, but that won’t stop us from continuing to enjoy them!

A classic martini with an olive garnish. Source
Source: http://www.cityofmartinez.org/our_city/martini.asp
http://www.sipsmith.com/blog/articles/the-history-of-the-martini