Apple Inc said on Friday it was working with Foxconn, its main contract producer for gadgets, to understand the cause of an explosion at a factory in China that local media have linked to the technology giant's iPad 2 production.

A large explosion rocked the Taiwanese company's plant in a high-tech industrial zone west of Chengdu, the capital of Sichuan province, killing at least two people, the Wall Street Journal reported.

Apple spokesman Steve Dowling said the company was assessing the situation.

We are deeply saddened by the tragedy at the Foxconn plant in Chengdu and our hearts go out to the victims and their families, he said. We are working closely with Foxconn to understand what caused this terrible event.

Two people were killed and 16 injured by the explosion, but the government has ruled out foul play, the Journal cited the Chengdu government as saying in a statement.

Foxconn, the world's largest contract manufacturer and an affiliate of Taiwan's Hon Hai, made headlines last year after reports emerged about poor working conditions at factories in southern China, which critics say may have helped drive several employees to suicide.

The company has pledged to improve employee welfare.

According to the Journal, the factory in Chengdu had some responsibility for making the iPad 2, Apple's latest version of the dominant tablet computer on the market.

Shares of Apple closed down 1.56 percent at $335.22 on Nasdaq.

(Reporting by Poornima Gupta; Editing by Lisa Von Ahn and Richard Chang)