BOAO, China, March 26 (Reuters) - A Chinese regulatory official sought to play down on Tuesday a slump in foreign direct investment (FDI) in the world's second-biggest economy, saying volatility was "normal" as authorities make efforts to attract foreign funds.

Official data show FDI shrank nearly 20% in the first two months of this year, following a contraction of 8% in 2023, as investor concern grew over a broader new anti-espionage law, exit bans and raids on consultancies and due diligence firms.

"The trend of China's foreign direct investment is basically in line with the global trend," Xu Zhibin, the deputy head of the foreign exchange regulator, told the annual gathering of the Boao Forum for Asia.

Corrections in the years 2022 and 2023 followed a high point in inflows in 2021, he added at the event, held in the southern province of Hainan.

"The volatility is quite normal when viewed from a global or Asian perspective, or when the trend is viewed on a longer timeline," Xu said.

Chinese officials have been stepping up efforts to attract investors, with Premier Li Qiang vowing on Sunday to keep up efforts to build a first-class business environment and welcome investment from enterprises all over the world. (Reporting by Kevin Yao; Writing by Liangping Gao; Editing by Clarence Fernandez)