The abrupt about-face from the US president was the latest twist in a conflict that has now lasted more than four months.