The accord brings Iran into China's Belt and Road Initiative, a multi-trillion-dollar infrastructure scheme intended to stretch from East Asia to Europe.
The project aims to significantly expand China’s economic and political influence, and has raised concerns in the United States.
China has spoken out often against U.S. sanctions on Iran and partly contested them. Iran's Foreign Minister Mohammad Javad Zarif called it "a friend for hard times".
China's Foreign Minister Wang Yi met President Hassan Rouhani ahead of the signing in Tehran. The agreement was expected to include Chinese investments in sectors such as energy and infrastructure.
Rouhani expressed appreciation of Beijing's support for Iran's position on its 2015 nuclear deal with world powers, in which it agreed to curb its nuclear program in return for the lifting of international sanctions.