BEIRUT — Iran has signed a deal to rebuild Syria's armed forces, which have been depleted by more than seven years civil war, Iranian Defense Minister Amir Hatami said on Monday.

Hatami, on a two-day visit to Syria, told the Beirut-based al-Mayadeen TV station that the agreement also stipulates helping rebuild Syria's military industry.

The announcement comes as the U.S. under President Donald Trump shifts is toughening its stance on Iran's support for Syrian President Bashar Assad's government, which has weathered a calamitous civil war.

The White House has demanded that Iran extract itself from Syria as an essential precondition to lifting sanctions that went into effect earlier this month.

Israel has also been critical of Iran's expanding role in Syria, saying it won't tolerate a permanent Iranian military presence near its frontiers.

Iran has been an essential backer of Syria's government in the civil war now in its seventh year, providing advisers, military supplies, training and thousands of militiamen to fight alongside the Syrian army.

Hatami said Iran was in Syria at the invitation of the government.

The precise details of the agreement were not announced.

The Syrian government does not release casualty numbers, but monitoring groups say the government has lost tens of thousands of fighters since the civil war broke out in 2011.

Iran and Russia both intervened on behalf of the government as opposition forces gained ground in the early years of the war.

Assad, who has ruled with an iron fist since inheriting the presidency from his father in 2000, now looks safe in his post but he rules over a shattered country.

At least 400,000 people have been killed in the war, according to monitoring groups, and the U.N. Economic and Social Commission for Western Asia estimates the economic damage to the country at over $300 bn.

The government and its international backers have described the conflict as a war against terrorism and enemies abroad, chiefly the U.S. and other western nations.

Hatami said Syria's government is now in a stronger position and warned against any "foreign aggression" against Syria.