* Apple says seeking tools to block hostile accounts
* China state media alleged Apple allowing illegal content
* Criticism comes as China-U.S. trade tensions rise (Updates with Apple confirmation of talks with China telcos)
BEIJING, Aug 2 (Reuters) - Apple Inc is speaking with Chinese telecom firms to find ways to reduce spam received through its messaging service, a spokeswoman said, days after state media alleged it was allowing illegal content on its platform.
The iPhone maker has been targeted by China's state media through the past week and the official state broadcaster railed against it in a 30-minute special report on Tuesday, saying Apple allowed illegal content such as gambling apps.
"We are in touch with domestic telco companies to see what additional steps could be taken to reduce this inconvenience," an Apple spokeswoman told Reuters on Thursday. It had on Wednesday declined to comment on the reports.
State-owned China News Service reported earlier that Apple was in contact with Chinese telecom companies among other measures it was taking to reduce junk messages.
"We are currently working on additional ways to further reduce it, including more advanced machine learning models to identify it and more tools to block fraudulent accounts," the Apple spokeswoman said.
Greater China is Apple's second-largest market and it said earlier this week that revenue in the country jumped 19 percent in the June quarter on strong iPhone X sales, showing investors it still had game even as cheaper Chinese rivals gain ground.
Beijing has criticised Apple before but the fresh attacks come as Chinese regulators have launched a new campaign to clean up spam and unsolicited calls, which are a pervasive issue in China where phone numbers are often sold on black markets.
The criticism highlights an increasingly fraught balancing act for the firm in the world's biggest smartphone market at a time of mounting trade tensions between China and the United States. Both countries have imposed tariffs on exported goods and are fighting over patents and technology.
While China is limited in its ability to match tariff for tariff, it has stepped up scrutiny of business dealings involving U.S. firms including Facebook Inc and recently scuppered a deal between U.S. chipmakers Qualcomm Inc and NXP Semiconductors.
Alphabet Inc's Google, which quit China's search engine market in 2010, will block some websites and search terms from the version of its search engine that it plans to launch in China, two sources have told Reuters. (Reporting by Beijing Monitoring Desk and Brenda Goh; Writing by Sayantani Ghosh; Editing by Sunil Nair/Himani Sarkar/Alexander Smith)