TRENTON, N.J. (AP) — Johnson & Johnson said Thursday it will lay off most of the staff at a factory idled over repeated recalls of Tylenol and other popular nonprescription medicines.

The healthcare giant said it has decided to make a significant investment in the manufacturing facilities, equipment and laboratories at its plant in Fort Washington, Pennsylvania.

The upgrades are part of a comprehensive quality-improvement plan that New Brunswick, N.J.-based Johnson & Johnson said it has submitted to the Food and Drug Administration.

About 300 of the 400 positions at the factory will be eliminated while it is out of service for what J&J is calling "a protracted period of time."

Asked about the timeframe, company spokeswoman Bonnie Jacobs said, "Our best estimate is at least the middle of next year."

The factory, operated by J&J's McNeil Consumer Healthcare unit, was shut down in April. The company said employees have continued to receive their salary and benefits, and will do so through at least mid-September. Those laid off will then receive severance packages.

McNeil is working on using other factories owned by Johnson & Johnson to resume making many of the 40 products that had been made in the factory, in a Philadelphia suburb.

As the company previously announced, most of the products made in Fort Washington are not likely to be available until next year.

Those include multiple versions of pain relievers Tylenol and Motrin, allergy treatments Benadryl and Zyrtec, Rolaids for upset stomach and Simply Sleep. Children's versions of some of the medicines were among the products recalled.

J&J said its plan includes manufacturing upgrades, "assessment and improvement of management controls, improvements in quality processes" and use of outside experts to further monitor quality while the plan is being implemented. The plan also includes "a comprehensive program to ensure sustainable compliance" with quality requirements set by regulators and McNeil.

"McNeil looks forward to the FDA's review of the plan and to working with the agency moving forward," the company said in a statement. "McNeil is committed to taking whatever steps are necessary to improve quality and earn consumers' trust."

Prior to the announcement late Thursday, J&J shares closed down 36 cents at $60.26.