Chinese and Hong Kong stocks declined on Tuesday as investors sold artificial intelligence and technology shares, while energy stocks gained amid rising concerns over a possible escalation of the Middle East conflict.

The CSI300 index fell 0.8% by midday, while the Shanghai Composite dropped 0.4%. Hong Kong's Hang Seng index was down 0.7%.

Technology stocks led the declines. China's CSI Artificial Intelligence Index slipped 2.1%, while the 5G Communication Index lost 1.8%. Major Hong Kong-listed technology companies fell about 2%, Reuters reported.

Memory-chip maker Changxin Technology dropped 3.7%, retreating after a 12% jump on Monday that pushed the stock to a record high. Huaan Securities expects continued strength across China's AI supply chain, with upcoming mid-August earnings likely to provide further confirmation of the sector's growth.

Energy shares bucked the broader market weakness as oil prices climbed on concerns that stalled efforts to resolve the U.S.-Iran conflict could lead to further escalation. PetroChina gained more than 2%, while coal stocks also advanced.

Consumer staples shares on China's mainland rose 0.4% despite signs of slowing economic activity. Industrial output and retail sales weakened at the start of the second half, highlighting the challenges posed by soft domestic demand and disruptions from extreme weather.

UBS analysts said earnings from several major consumer companies due this week will be closely watched for indications of the underlying strength of consumer demand.

Robotics stocks also outperformed, with the Robot Industry Index rising nearly 1%. Leader Harmonious Drive Systems surged 5.5% ahead of the planned market debut of humanoid-robot maker Unitree on Wednesday.

The market's performance reflected a divide between continued optimism around AI and robotics and growing concerns over China's economic momentum and geopolitical risks, Reuters reported.

(Disclaimer: Recommendations, suggestions, views, and opinions given by experts are their own. These do not represent the views of The Economic Times.)