Last week the Trump administration said it would be "silly" to persist with trying to oust Syrian President Bashar al-Assad.

President Donald Trump's position had been that destroying Islamic State was a higher priority.

Today he ordered an airstrike on a Syrian airbase in response to a deadly chemical weapons attack American officials believe was launched by Syrian Government aircraft.

Here's how the events of this week changed Mr Trump's mind.

'What I'm saying is, stay out of Syria'

As a private citizen, Mr Trump urged against taking military action in Syria in response to a similar chemical attack by Assad's forces in 2013.

Around that time, citizen Trump said on Twitter:

Loading

An opinion he reiterated repeatedly:

Loading

Loading

Mr Trump was still opposed to aggressive action in Syria after becoming the Republican nominee during the 2016 presidential election campaign.

In an interview just weeks out from election day, he said his opponent's policies on Syria, which included the establishment of a no-fly zone, would lead to a world war.

"What we should do is focus on ISIS. We should not be focusing on Syria," Mr Trump said.

"You're going to end up in World War III over Syria if we listen to Hillary Clinton.

However, this week's horrific chemical attack changed things for now-President Trump.

'My attitude to Syria has changed'

In a press conference with Jordan's King Abdullah II, he said the attack "crossed a lot of lines".

Loading

Mr Trump said he was a "flexible person", and didn't have to hold to his beliefs if the world changed.

"That attack on children yesterday had a big impact on me. Big impact," he said.

"My attitude to Syria and Assad has changed very much."

That signalled a rapid shift in the administration's response to the Syrian conflict.

First, US Ambassador to the UN Nikki Haley took it up to Russia on the issue.

Loading

Then US Secretary of State Rex Tillerson, who normally stays out of the spotlight, was front and centre and had tough words for the Assad regime, claiming that "steps are underway" to build an international coalition to oust Assad.

Loading...

Finally, here's what Mr Trump said in a brief chat with the press aboard Air Force One earlier today.

"I think what happened in Syria is a disgrace to humanity, and he's there, and I guess he's running things, so I guess something should happen."

And then when he was pressed by reporters:

"I don't want to say what I'm going to be doing with respect to Syria."

Hours later, the US launched a cruise missile strike on the Syrian airbase where it says the Syrian military planes that dropped the chemicals had taken off.

In a brief statement, Mr Trump said it was in the national security interest of the US and its allies to prevent and deter the spread of chemical weapons.

"Tonight, I call on all civilised nations to join us in seeking to end the slaughter and bloodshed in Syria. Also, to end terrorism of all kinds and all types," he said.

He also said the strike was in the "vital national security interest of the United States".

This piece is based on reporting by Zoe Daniel and Roscoe Whalan from the ABC's US bureau in Washington DC.