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.)

The Instagram posts, from British American, Global Vaping Group, Attitude Vapes and Ama Vape, were found to be in breach of a 2016 British law that prohibits companies from advertising e-cigarettes containing nicotine online unless they are licensed as medicine. Some posts were found to have violated rules that prohibit ads for e-cigarettes that feature someone under the age of 25.

Mark Hurley, the director of international communications at the Campaign for Tobacco-Free Kids, one of the groups that filed the complaints, said the rulings were a huge step forward, but he called for further action.

“Urgent policy change is needed from Facebook, Instagram and Twitter,” Mr. Hurley said, “to prevent BAT and other tobacco companies from using social media to advertise their harmful products to young people around the world.”

One of the Instagram posts from Vype featuring Ms. Allen said: “Wishing our friend @lilyallen the very best at tonight’s #BritAwards where she’s nominated for Best British Female Solo Artist!” After a series of hashtags including “#vype, #vapecommunity, #vapenation,” the post said, “Vype e-cigarettes contain nicotine. 18+ only. Read leaflet in pack.”

The other post mentioned a promotion with the House of Holland, a fashion label, during London Fashion Week.

British American Tobacco, with a reported revenue over $240 million from vaping products for the first half of 2019, argued that its Vype Instagram account was equivalent to information provided on the company-owned site, where British law allows e-cigarette brands to publish factual information, including the vaping product’s name, content and price.

But the regulator said the Vype posts promoting e-cigarettes with nicotine “clearly went beyond” standards for factual claims and directed the firm to remove all promotions related to Vype. The page has since been made private.

Regarding other complaints, British American conceded that a model in one of its Instagram posts was under the age of 25, and that it was reviewing its age-verifying process for people who might feature in future communications. The regulator rejected a complaint that some of the British American posts were aimed at teenagers.

Representatives for Global Vaping Group, Attitude Vapes and Ama Vape could not be reached for comment.

In the United States, many television networks have dropped advertisements for e-cigarettes. Juul Labs, the dominant American brand, has suspended all broadcast, print and digital advertising nationwide as it faces several federal investigations.