SHANGHAI, Aug 17 (Reuters) - Hong Kong stocks closed lower on Tuesday, marking their biggest fall in three weeks, as sentiment took a hit due to a gloomy economic outlook for China, Beijing's tighter control of the tech sector, and rising geopolitical tensions.

The Hang Seng index fell 1.7% to 25,745.87, while the China Enterprises Index lost 2.2% to 9,057.88. Both the indexes had their worst day since July 27.

Sharp deceleration in China's factory output and retail sales in July dented investors' confidence, dragging cyclical stocks lower.

China's "July activity data deteriorated across the board, significantly below market expectations," Nomura said in a note.

"We expect major activity indicators to deteriorate further in August."

The Hang Seng Tech Index tumbled 3.1%, after China tightened control of its technology sector further, publishing detailed rules on Tuesday that aimed at tackling unfair competition and companies' handling of critical data.

Video platform Bilibili Inc, social media company Tencent Holdings, e-commerce giant Alibaba and food-delivery service Meituan plunged.

Denting the mood further, China carried out assault drills near Taiwan, with warships and fighter jets exercising off the southwest and southeast of the island, in what the country's armed forces said was a response to "external interference" and "provocations".

China Evergrande Group dropped 4.3%, after news that chairman Hui Ka Yan has stepped down as chairman of flagship unit Hengda Real Estate Group, fuelling expectations of a possible restructuring.

Healthcare and material shares also dropped sharply, with indexes tracking the sectors falling 3.1% and 4.3% respectively. (Reporting by the Shanghai Newsroom; editing by Uttaresh.V)