Household products giant Reckitt Benckiser has agreed to pay a £10.2m fine after admitting to abusing its market position for the supply of heartburn drug Gaviscon.
The Office of Fair Trading (OFT) had accused the firm in February of restricting competition in the supply of heartburn medicines to the NHS.
The inquiry followed an investigation by the BBC's Newsnight in 2008.
Reckitt said it respected the OFT's view and had agreed to settle.
But it added that it believed it had acted within the law at the time.
The OFT said the fine had been reduced from £12m, reflecting Reckitt's admission and early co-operation with the watchdog.
But it said the £10.2m was still the highest penalty it had imposed in an abuse-of-dominance case.
Ann Pope, senior director at the OFT, added: "This important case was brought to our attention by BBC Newsnight, after a whistleblower took his story to the programme.
"The fine announced today sends a clear signal to businesses in a dominant position that we will take strong action against this sort of anti-competitive behaviour."
Reckitt withdrew the original Gaviscon from the NHS in 2005, and patients were transferred to Gaviscon Advance.
When a branded medicine's patent has expired, a "generic name" is assigned to it.
Patients are then provided with an "open" prescription that lists its generic name. Pharmacies can choose whether to dispense the relevant brand or equivalent but cheaper generic medicines.
The OFT says this choice provides for strong price competition between pharmaceutical suppliers and can result in considerable savings to the NHS.
An OFT statement said: "The OFT's allegation was that Reckitt Benckiser withdrew NHS packs of Gaviscon Original Liquid from the NHS prescription channel after the product's patent had expired but before the publication of the generic name for it, so that more prescriptions would be issued for its alternative product, Gaviscon Advance Liquid.
"Pharmacies that receive prescriptions for Gaviscon Advance Liquid must dispense it, as it is patent protected and there are no generic equivalent medicines."
Reckitt said in a statement: "This OFT investigation relates to an infringement that took place a number of years ago under a highly complex area of competition law, on which there have only more recently been clarifying cases.
"Therefore, while the company believed at the time it was acting within the law, as is always our intent, we respect the view of the OFT in this matter and have agreed to settle."