Egyptian president Abdel-Fattah El-Sisi said the last two years have been "a real test that showed the strength of the strategic relations between Egypt and the US".
Speaking late on Tuesday to the American Public Broadcasting Service (PBS) in New York, El-Sisi stressed the importance of the US not abandoning Egypt during what El-Sisi called turbulent times.
El-Sisi is expected to head back to Cairo on Tuesday having concluded his five-day visit to the US.
Egypt's president also highlighted that relations between Cairo and Washington have become stronger.
Cairo and Washington are long-time allies but relations soured following the 2013 ouster of Islamist president Mohamed Morsi.
Tensions have now eased, with the US resuming its $1.3 million annual military aid to Cairo in March, having partly suspended it in the aftermath of the ouster. The aid is intended to boost Cairo's ability to combat the threat posed by extremists.
Right to protest organised
“We will not and we did not ban demonstrations, but we have regulated the right to protest... as we are seeking stability... we are not a rich country and we could not afford instability,” said El-Sisi when asked about the right to protest.
He also stressed that many countries have issued laws concerning protests.
"We need to make progress and build our country after years of stagnation," he said.
El-Sisi said the "dream of Tahrir Square" has "never died" when asked about it, and said no president could rule the Egyptians against their will.
“Terrorism is not an easy phenomenon to counter,” El-Sisi went on, saying that although the US has experience in its battle against terrorism it took a long time to eliminate the terrorist threat.
Speaking about the growing strength of ISIS, El-Sisi said that the international coalition – of which Egypt is a member - is capable of defeating it militarily.
However he stressed that this approach is incomplete, pointing to the need for a comprehensive approach that includes economic, social and cultural dimensions.
With regard to the situation in Syria, El-Sisi said that he supports a political solution, not a purely military one.
The recent pardoning of 100 prisoners
El-Sisi recently pardoned 100 prisoners, including Al Jazeera's TV journalists Mohamed Fahmy and Baher Mohamed, and prominent youth activists who were charged with violating the protest law.
El-Sisi told the PBS that when the judiciary procedures concerning the prisoners were over there was a chance for him to step in and to issue a pardon.
Asked if he can intervene to release other arrested journalists, El-Sisi said there is no legal way for him to intervene, but the courts will deal with these issues.