US President Donald Trump, who has threatened to destroy Iran's civilization, has announced a two-week ceasefire.

The ceasefire comes two hours before the US deadline for Tehran to reopen the Strait of Hormuz.

Reacting to the ceasefire and peace talks, Iran said talks with the US were due to begin in Islamabad, Pakistan, on Friday. The Iranian government has said it considers Pakistan a neutral country in the conflict after the Pakistani prime minister brokered the ceasefire.

Iranian state television said Trump had accepted Iran's conditions to end the war, describing it as a "humiliating retreat" by the US president.

The US president has said that the US has decided to seek a ceasefire if Iran agrees not to disrupt oil and gas supplies through the Strait of Hormuz.

The Strait of Hormuz, which handles about a fifth of global oil traffic, will stop attacks on the strait and provide security, Reuters news agency quoted Iranian Foreign Minister Abbas Araqchi as saying.

“This will be a two-way ceasefire. We have already met all military objectives. We are moving towards a definitive agreement for long-term peace with Iran and peace in the Middle East,” Trump wrote on his Truth social media platform.

The war, now in its sixth week, has claimed more than 5,000 lives in nearly a dozen countries, according to government sources and human rights groups. Among the dead are more than 1,600 civilians in Iran.