Brazil has decided not to break the patent on a key HIV/Aids drug after its US manufacturer agreed to reduce the drug's price over the next six years.
The government says 600,000 Brazilians have HIV/Aids
The Brazilian government and Abbott Laboratories reached the agreement after 10 days of talks.
Brazil had said it would start making a cheaper generic version of the drug, Kaletra, increasing pressure on the manufacturer to cut its price.
As part of the deal, Brazil will have access to Kaletra's next new formula.
Brazil currently pays Abbott $107m (£61.3m) a year for Kaletra, which it provides to patients for free.
Abbott has agreed that Brazil can treat more patients with no overall increase in costs, in effect reducing the price of the drug and saving the government more than $250m over the next six years.
The manufacturer had said Brazil enjoyed the most generous pricing agreement of any country outside Africa.
It argued that if patents were broken, pharmaceutical companies would be deterred from investing in further research.
Brazil has reached similar agreements with pharmaceutical companies in the past after threatening to break patents.
Kaletra is one of the most widely used anti-retroviral drugs, which are essential to the treatment of HIV.
The case is being followed closely in the developing world, where about 36 million people have the HIV virus.
The government's last-minute change of heart is sure to anger HIV campaign groups, says the BBC's Steve Kingstone in Sao Paulo.
They had urged Brazil to break the patent, arguing that this would be legal under World Trade Organization rules and would help bring down worldwide prices for anti-retroviral drugs.