The Instagram posts looked like so many others: a celebrity endorsing a product. In this case, the British singer Lily Allen sliding a sleek e-cigarette into her shoulder pocket. In another, Ms. Allen sports a coy smile and holds an e-cigarette at arm’s reach.

But on Wednesday Britain’s advertising regulator ruled that the posts by Vype, a unit of British American Tobacco, violated a law prohibiting the promotion of e-cigarettes online, and ordered the posts taken down.

The regulator, the Advertising Standards Agency, issued a series of decisions against British American and three other makers of e-cigarettes, all for illegally promoting their products on Instagram. It was the first time the agency has acted against vaping promotions on Instagram.

The rulings were hailed by health advocates, who pointed to outbreaks of lung injuries and more than 40 deaths in recent months tied to vaping, which has been marketed as a healthier alternative to cigarettes. (The illnesses have been found in people who vaped nicotine and marijuana products.)