Apple Inc. said Tuesday it played no role in the National Security Agency’s alleged efforts to hack the iPhone, explaining that it was unaware of a recently revealed program aimed at turning the best-selling smartphone into an improvised listening device.

The Cupertino, Calif.-based, company said it had never worked with the NSA to deliberately weaken its products. It promised that it would “defend our customers from security attacks, regardless of who’s behind them.”

The revelation was one of series of disclosures which have rattled the NSA in the past six months.

Apple’s statement follows the disclosure by privacy advocate Jacob Appelbaum of a leaked document describing an NSA-designed “software implant” intended to turn an iPhone into a pocket-sized informer, secretly recording audio, stealing files and harvesting contact information.