Apple has said it has suffered a cyber attack on iPads and iPhones in China.

In what is considered to be the first major attack on Apple's App Store, the tech giant said it had taken steps to remove the malicious software from apps used by the devices.

"We've removed the apps from the App Store that we know have been created with this counterfeit software," Apple spokeswoman Christine Monaghan said in an email.

"We are working with the developers to make sure they're using the proper version of Xcode to rebuild their apps."

Apple said hackers were able to embed the code - named XcodeGhost - by encouraging developers to use a fake version of its own software.

Cyber security firm Palo Alto Networks said that the hack may have affected hundreds of millions of users.

"We believe XcodeGhost is a very harmful and dangerous malware that has bypassed Apple's code review and made unprecedented attacks on the iOS ecosystem," the firm said on its website.