RIYADH -- Chinese President Xi Jinping and his Iranian counterpart, Hassan Rouhani, on Saturday agreed to a deal that calls on China to provide financial aid for the development of a high-speed railway in Iran.

The deal was among 17 agreements on economic and technological cooperation that the two leaders signed in Tehran.

Xi, who is currently touring the Middle East, became the first head of state to visit Iran since economic sanctions were lifted earlier this month as part of a nuclear nonproliferation agreement. He also met with Iranian Supreme Leader Ayatollah Ali Khamenei.

After the meeting, Rouhani said Tehran plans to significantly increase trade with China in the next 10 years to $600 billion from around $52 billion in 2014, according to the Iranian Foreign Ministry.

The planned railway is to connect Tehran and the northeastern city of Mashhad, Iran's second-largest city, along a route of about 900km. China is to undertake the project as part of Xi's "One Belt, One Road" initiative, meant to create a trade corridor between China and Europe. The agreements also confirm that the two countries will cooperate on the Chinese initiative.

During the meeting, Xi and Rouhani also discussed counterterrorism measures and increased tensions in the Middle East following the severing of diplomatic relations between Iran and Saudi Arabia. They agreed to strengthen their collective efforts to fight extremists.

Before Iran, Xi made stops in Saudi Arabia and Egypt. In a speech to the Arab League on Thursday, Xi unveiled a plan to spend $55 billion in the region. Of the total, $35 billion will take the form of loans, including $15 billion for industrialization and $20 billion as a fund for the United Arab Emirates and Qatar.