South African President Cyril Ramaphosa poses for a photo at the Union Buildings in Pretoria on September 13, 2024.  (Photo by Wikus de Wet / AFP)

President Cyril Ramaphosa's office criticised South Africa's top general on Thursday for reported comments about solidarity with Iran as unhelpful during the process of resetting ties with the United States.

The foreign ministry has also condemned South African National Defence Force chief General Rudzani Maphwanya for his statements during a recently-ended trip to Iran, and a leading political party has called for his court-martial.

Pretoria is working to improve its rock-bottom ties with Washington, with the aim of reaching a new trade deal that will avoid 30 percent tariffs on its exports.

"We are in a process of managing a very delicate exercise of resetting diplomatic relations with the United States," Ramaphosa's spokesman said at a media briefing.

During these negotiations, it was "not helpful" to have "senior government or military officials making statements that will inflame the situation," Vincent Magwenya said.

The Tehran Times reported on Tuesday that Maphwanya had called for deeper cooperation with Iran, especially in defence matters, during meetings with top Iranian defence officials.

Iran's state-owned Press TV reported that the South African general had affirmed the two countries had "common goals" and also condemned Israel's actions in Gaza.

"At this period of heightened geopolitical tensions as well as conflict in the Middle East, one can say the visit was ill-advised," Magwenya said, adding that Ramaphosa had not been aware of the visit.

The Democratic Alliance, the second-largest group in the government of national unity, has demanded that Maphwanya be court-martialled for "breaching military neutrality".