Iran will maintain its military presence in Syria despite demands from the United States and Israel that it withdraw, Iran's military attache in Damascus has said.

"The continued presence of Iranian advisers in Syria was part of this military cooperation agreement between Tehran and Damascus" that was signed by the two nations' defense ministers over the weekend, Brigadier-General Abolqasem Alinejad said on August 28, according to Iranian news agencies.

"Iran will help Syria in clearing minefields in different parts of the country... Iran will help Syria to rebuild the military factories that were damaged in the war," Alinejad said.

Iran's Islamic Revolutionary Guards Corps has sent weapons and thousands of fighters to Syria to help shore up Syrian President Bashar al-Assad during his seven-year-long civil war with Sunni Muslim rebels.

Iranian Defense Minister Amar Hatami visited Damascus over the weekend and signed a deal for military cooperation at a time when both Israel and the United States have been demanding that Iran withdraw its advisers and fighters as part of any final settlement of the Syrian war.

U.S. National Security Adviser John Bolton last week repeated Washington's call for Iran to remove all its forces from Syria.

The United States is reimposing economic sanctions against Iran partly over its involvement in the conflicts in Syria and Yemen as well as over its nuclear and missile programs.

Israel has also been adamant that Iran should withdraw from Syria, and has been particularly wary of Iran's involvement in building factories for weapons that Tel Aviv fears will be used against the Jewish state.

"The pact between Syria and Iran for rehabilitating the Assad army is an excuse and a facade meant to grant legitimacy to the Iranian forces remaining in the area," Israeli Public Security Minister Gilad Erdan told Ynet TV on August 28.

"But as far as we are concerned, no machinations keeping the Iranians in the area will be acceptable," he said.

A senior Israeli official told reporters that Israel's military, which has staged deadly air raids against Iranian positions and facilities in Syria, "will continue to act with full determination against attempts by Iran to transfer military forces and weapons systems to Syria."

More than 1,000 Iranians, including senior members of the elite Revolutionary Guards, have been killed in the air raids and in battlefield action in Syria since 2012.

The guards initially kept quiet about their role in Syria. But in recent years as casualties have mounted, they have been more outspoken, framing their engagement as a struggle against Sunni Muslim fighters of the Islamic State who regard the Shi'a who form Iran's majority as apostates and have staged a growing number of attacks against them.

With reporting by AFP and Reuters