In 2012, the company behind the EpiPen settled a lawsuit by agreeing to allow a generic competitor into the market in 2015, potentially cutting into a big part of its business.

The company, Mylan, had already been steadily increasing the price of EpiPen, an injector containing a drug that can save people from life-threatening allergy attacks. After the settlement, it started to raise the price even faster.

Now, as Mylan faces growing public furor over its pricing of EpiPen, the company’s history of pricing the product highlights a common tactic in the drug industry: sharply raising prices in the years just before a generic competitor reaches the market, as a sort of final attempt to milk big profits from the brand-name drug.

Whether the looming generic competition was a motive for the price increases is not entirely clear, because Mylan has declined to answer questions about its thinking. But while the company was once taking two 10 percent price increases a year, it has made two 15 percent increases annually starting in 2014, when the generic competition seemed imminent.