BRUSSELS—Lawmakers at the European Parliament on Wednesday approved a ban on menthol and other flavored cigarettes as part of broad legislation that will sharply restrict how tobacco products can be sold across the 28-nation European Union.

The legislation would also require most electronic cigarettes—battery-powered devices that turn a liquid nicotine mixture into an inhalable mist—to be regulated like medicines. That could subject the increasingly popular devices, used primarily by smokers to help quit, to extensive safety...