Yes. Yes it did.
When Coca Cola was first introduced in 1886, a new (briefly enacted) law in Atlanta had been passed prohibiting the manufacture and sale of alcohol. Inventor John Pemberton created a beverage that was inspired by something called “coca wine” which was popular in France at the time, which mixed extract from the coca leaf with wine.
Instead of wine (now illegal), he mixed the coca leaf extract with sugar syrup and added kola nut extract (which contains caffeine). This combination gave the product the name Coca-Cola.
Strangely, while alcohol was illegal, cocaine was not (and didn’t become illegal until 1914). Cocaine was commonly found in a variety of products at the time.
[Cocaine] had a variety of (sometimes questionable) medical uses. Cocaine tonics, powders and pills were popularly believed to cure a variety of ailments, from headache and fatigue to constipation, nausea, asthma and impotence.
Is there still cocaine in Coca-Cola?
In the early 20th century the formula was adjusted to contain a non-narcotic extract from the coca leaf and cocaine was phased out. Coca-Cola still contains coca extract to this day but contains no cocaine.
…by 1902 it was as little as 1/400 of a grain of cocaine per ounce of syrup. Coca-Cola didn’t become completely cocaine-free until 1929, but there was scarcely any of the drug left in the drink by then.