The first warning sign came when a sharp-eyed worker sorting pills noticed that the odd blue flecks dotting the finished drug capsules matched the paint on the factory doors.

After the flecks were spotted again on the capsules, a blood-pressure medication called diltiazem, the plant began placing covers over drugs in carts in its manufacturing areas.

But the factory owner, Canadian drug maker Biovail Corp., never tried to find out whether past shipments of the drug were contaminated - or prevent future contamination, according to U.S. regulators.

Thirteen of the 20 best-selling drugs in the United States come from plants on this island. But an investigation by The Associated Press has found dozens of examples over four years of lapses in quality control in the Puerto Rican pharmaceutical industry, which churns out $35 billion of drugs each year, most of it for sale as part of the $300 billion market in the U.S.

An AP review of 100 pages of Food and Drug Administration reports shows even modern drug plants here under the watch of U.S. regulators have failed to keep laboratories sterile and have exported tainted pills.

"People would be shocked to find this whole variety of contamination," said Dr. Sidney Wolfe of the Washington watchdog group Public Citizen. "The common denominator of all these is there's really poor quality control."

FDA officials say the problems in Puerto Rico are proportionate with the large number of pharmaceutical plants here and generally no worse than those on the U.S. mainland.

Consumer advocates say they demonstrate the regulatory agency does not sufficiently monitor the industry across Puerto Rico and in the mainland.

The FDA issued a warning letter to Wyeth in May 2006, after consumers reported finding machinery pins inside bottles of Effexor, a leading depression treatment, and the heartburn drug Protonix. The letter expressed concern that the plant was not "able to detect that the affected equipment was missing some of its parts." The Madison, N.J.-based company faulted mistakes by workers who packaged the drugs.

In another case cited in a June 2006 FDA inspection report, a plant owned by Teva Pharmaceutical Industries exported drugs - including the diabetes treatment metformin - even though they were known to contain small amounts of metal particles. The company had also received at least six consumer complaints of dark residue inside bottles or foreign material embedded in tablets, according to the report.

Teva's quality-control unit said the presence of some metallic material was to be expected because the manufacturing equipment is made of metal, according to the report.

Teva recalled 21 different drugs as a result of the inspection, according to FDA officials, and the Israeli drugmaker announced two months later it was closing the plant, citing a restructuring.

Denise Bradley, a Teva spokeswoman, insisted the medicine from the now-closed plant was safe and effective despite the contamination.

The reports obtained by AP were produced by FDA inspections from 2003 to 2007 of 13 pharmaceutical plants - roughly half the total in this U.S. territory, a Caribbean island with one of the world's highest concentrations of drug makers.

Several are closing or downsizing as the expense of updating decades-old plants to meet regulations adds to struggles with rising energy costs and tightening tax breaks.

The FDA often hesitates to crack down at the first sign of problems because manufacturers can chalk them up to isolated mishaps, said John Scharmann, a former FDA administrator for the Denver district now associated with a watchdog group.

That appeared to be the case at the Biovail-owned factory in the San Juan suburb of Carolina where the sharp-eyed worker noticed the foreign specks of blue.

"Incident was considered an isolated event ... even when the employee reported having observed the same particles before," the report said.

David Elder, director of enforcement in FDA's regulatory affairs office, said pharmaceutical companies generally fix problems on their own and issue recalls if necessary once notified.

"They're making products that save or support lives, so it's not in their interest to make products that are unsafe or ineffective," he said. "I think they're good corporate citizens by and large and want to do right by their patients."

Four of the plants described in the reports closed or announced plans to do so after the discovery of significant quality-control problems, but none of them cited the discoveries as a reason for closing.

One of those four, GlaxoSmithKline PLC, produced tablets of the popular antidepressant Paxil CR that split apart, potentially causing patients to take incorrect dosages.

When the company would not recall all the affected pills, U.S. marshals raided the plant in March 2005 in the largest drug seizure in FDA history and also collected tablets of the diabetes treatment Avandamet after some were found not to have accurate doses of the active ingredient.

Some plants in Puerto Rico are three decades old, built when the territory's pharmaceutical industry took off thanks to tax incentives aimed at developing more high-tech manufacturing.

The industry here has faded somewhat. Companies have shed more than 3,000 jobs in the last 18 months and closed several plants for a variety of reasons, including the loss of federal tax breaks and cost-cutting.

Still, this island turns out some top-selling drugs on the U.S. market, including cholesterol drugs Lipitor and Zocor, the blood-thinner Plavix, anemia drugs Aranesp and Epogen and the antidepressant Zoloft.

The FDA's San Juan office has 22 inspectors who devote about a quarter of their time to pharmaceutical plants. They typically visit the factories once every two years, more often if there are consumer complaints or the company has repeated infractions.

Factories confronted with violations often make extensive changes. The Biovail plant invested $5 million in equipment upgrades and addressed problems including errant metal particles from cleaning spatulas. A follow-up FDA inspection found no problems, said Gilbert Godin, executive vice president of the Ontario-based company.

Scharmann, a consulting editor for the watchdog publication Dickinson's FDA Review, said the FDA is concerned by anything that affects drug quality but considers the likelihood that the companies may file legal challenges to enforcement actions.

"There's a fairly broad latitude that is allowed," Scharmann said.

Elder contends inspections are rigorous.

"The folks doing this work aren't just regulators. That's our job, but we're also consumers of these products," he said. "It's personal to us to make sure these products are in compliance."