But in a series of tweets in June, August and September 2013, Trump made his views very clear and warned Obama against attacking Syria.
At the time Trump even said: "The President must get Congressional approval before attacking Syria-big mistake if he does not!"
Approval was not something Trump bothered to get before he launched the strike on Thursday, something that had Democrats, along with Republican senator Paul Rand fuming.
University of Sydney lecturer Sarah Graham of the US Studies Centre said the military action was a big turnaround for Trump.
"It is a 180 degrees turn for the President who had stated the position that there were no viable options to remove the Assad regime from power," Dr Graham told news.com.au.
She said it was worth bearing in mind the domestic context.
"Trump's approval rating is at an unprecedented low, and he has been dogged by the questions surrounding his campaign's ties to Russia and the failure of his legislative agenda around health care," she said.
"This decisive response against a human rights outrage changes the conversation on how his presidency is going, to Trump's advantage.
"Although Trump still needs to be careful because the public is weary of military adventurism in the Middle East."
Dr Graham said it was impossible to know for certain what motivated the change in Trump's position and people may have to wait for his memoirs to get some deep insight into the decision.
But she said three possibilities stood out to her. The first was that his top national security advisers HR McMaster, James Mattis and Rex Tillerson, reached a consensus that may have persuaded the President to authorise the retaliatory strike.
"These three are by disposition more hawkish and interventionist than Trump," she said.
Secondly, she said Trump and his administration had already made statements on a range of international issues since taking office, which had hinted at a more hawkish and interventionist posture than the "America First " rhetoric of the campaign.
"So Trump's own thinking might have been shifting already," she said.
It's also possible that Trump's conscience was stirred by Assad's atrocity.
"In his speech, Trump made the case to the American public that the attack was a human rights outrage and an infringement of international humanitarian law that required a strong response.
"This is indeed a very striking change from Trump's prior statements on human rights and the US's role in policing them."
Regardless of the motivation, Dr Graham said Trump's action would deliver a message.
"Around the world the message will be that Trump is not as wary of using military force as we might have thought from his campaign rhetoric," she said.
"And it sends the message that Trump is capable of acting much more swiftly and decisively than Obama."
But the irony of Trump's change of heart was not lost on those online:
But others supported Trump's action, despite the hypocrisy.
Obama, who was a vocal opponent to Assad's use of chemical weapons, ended up sending a specially-equipped US naval ship to destroy the Syrian President's chemical weapons after the UN Security Council backed a US-Russia deal in 2013 to remove and destroy the arsenal.
The agreement was brokered as a way to avert US missile strikes that Washington threatened after a chemical attack near Damascus, which Washington and other Western governments blamed on the regime.