China has pledged two billion yuan ($327 million) in aid to Afghanistan, which is seeking new sources of foreign help amid a drawdown of U.S. troops and increasing worries about regional instability.

The offer of aid through 2017 came after China’s President Xi Jinping and newly elected Afghan President Ashraf Ghani met in Beijing on Tuesday, according to a joint declaration published Wednesday by China’s foreign ministry. Beijing and Kabul also agreed to step up intelligence sharing to fight drug trafficking and address other...