Apple Inc said on Friday it will stop selling its latest iPhone in its retail stores in Beijing and Shanghai to ensure the safety of its customers and employees.

The iPhone 4S, which went on sale early Friday, caused a near-riot in one of Apple's Beijing retail stores.

The demand for iPhone 4S has been incredible and our stores in China have already sold out, an Apple spokeswoman said.

Unfortunately, we were unable to open our store at Sanlitun due to the large crowd. And to ensure the safety of our customers and our employees, iPhones will not be available in our retails stores in Beijing and Shanghai for the time being, she said.

Customers will still be able to order the smartphone online or purchase it through Apple's partner in China, China Unicom.

(Reporting by Melanie Lee; Editing by Jacqueline Wong)