MUMBAI, India — While China was becoming the world’s shop floor, India took its place as the world’s pharmacy, and in recent decades has been the largest provider of cheap, lifesaving medicines in poor countries across the globe.

But most of that medicine has been generic copies of brand-name drugs protected by patents in Europe and the United States. Now a big Swiss drug company, Novartis, may be one legal step away from upending the Indian supply chain by forcing the Indian government to recognize a patent for a cancer treatment heralded as a breakthrough for people with a deadly form of leukemia.

The case, involving the drug Gleevec, is before the Indian Supreme Court, which is preparing to hear final arguments this month. It represents a high-stakes showdown between defenders of intellectual property rights, who say the generic knockoffs stifle innovation by drug makers, and Indian drug companies and international aid groups, who warn that a ruling in favor of Novartis could dry up the global supply of inexpensive medicines to treat AIDS, cancer and other diseases.

The case has attracted international attention. AIDS activists and others protested recently outside Novartis’s annual shareholders meeting in Basel, Switzerland, and also at Novartis offices in New York, Washington and Cambridge, Mass., demanding that the company drop the case.