After John Pemberton was wounded in the Civil War, he got addicted to morphine. So he started looking for alternative painkillers. He made his own coca wines, which are a mix of alcohol and cocaine. In 1886, when working on a non-alcoholic version, he invented Coca-Cola.
Source: Unbelievable Facts