The history of coffee has been recorded as far back as the ninth century. During that time, coffee beans were available only in their native habitat, Ethiopia, but, when the Arab world began expanding its trade horizons, the beans moved into northern Africa and were mass-cultivated. From there, the beans entered the Indian and European markets, and the popularity of the beverage spread.
The word "coffee" entered English in 1598 via Italian caffè. This word was created via Turkish kahve, which in turn came into being via Arabic qahwa, a truncation of qahhwat al-bun or wine of the bean. Traditional Islam prohibits the use of alcohol as a beverage, and coffee provided a suitable alternative to wine.
There are several legendary accounts of the origin of the drink itself. One account involves the Yemenite Sufi mystic Shaikh ash-Shadhili. When traveling in Ethiopia, the legend goes, he observed goats of unusual vitality, and, upon trying the berries that the goats had been eating, experienced the same vitality. A similar myth attributes the discovery of coffee to an Ethiopian goatherder named Kaldi and the Legend of Dancing Goats.
One possible origin of both the beverage and the name is the Kingdom of Kaffa in Ethiopia, where the coffee plant originated (its name there is bunn or bunna).