The president repeated his tough stance on tariffs, saying allies had been "taking advantage" of the U.S. on trade.
He also denied the summit had been contentious, a remark that contradicted what one G7 official described as an "extraordinary" exchange on Friday in which Trump repeated a list of trade grievances, mainly concerning the European Union and Canada.
In any event, Trump's Saturday night Twitter is sure to send shockwaves through the diplomatic community and is certainly a stunning turnaround just hours after Trump appeared to leave Canada a happy man boasting of the relationships he gained.
French President Emmanuel Macron, who has invested in a warm personal relationship with Trump, said the other G7 nations - Britain, Canada, Germany, Italy and Japan, as well as France - should remain "polite" and productive but warned that "no leader is forever", a sign that Europe would not surrender meekly to the U.S. president.
Apart from trade, there also was disagreement at the summit over the G7's position on climate change and Trump's suggestion that Russian Federation be re-admitted to the group.
The president's sharp comments came as he is now en route to Singapore for a highly anticipated meeting with North Korean leader Kim Jong Un, set to be held on Tuesday.
In an "extraordinary" exchange between the leaders on Friday, Trump repeated a list of grievances about USA trade, mainly with the European Union and Canada, a French presidency official told reporters.
"It's very unfair to our farmers".
Macron said he and Trump held "open and direct" discussions, adding that he thought there was a way to get a "win-win" outcome on trade, though details remained unclear.
Trump said, referencing the Canadian tariff levied on US and foreign milk imports. "It's going to stop or we'll stop trading with them", he said.
Trudeau told reporters that the United States justification for the tariffs on steel and aluminum on national security grounds was "laughable", triggering a riposte from Trump on Twitter.More news: President Trump signals support for legislation easing US ban on pot
The tweets resumed the president's attacks on what he had been describing in the leadup to the summit as Canada's unfair trade policies.
Leaders at the 2017 G7 summit in Sicily.
Earlier on Saturday, Trump told reporters it would be "very easy" to make the case for tariffs on auto imports using the rationale that they threaten national security.
According to The Washington Post, Trump complained about having to go to the summit as he considered it an unwanted distraction from his upcoming summit with Kim Jong Un in Singapore and didn't want to be confronted by other G7 leaders on trade.
Trump himself is expected to be the last leader to arrive at the Group of Seven to arrive in French-speaking Quebec, trailing his counterparts from Germany, Britain, France, Italy and Japan as well as the host Prime Minister Justin Trudeau.
The President bragged he would know within a minute of meeting North Korea's dictator on June 12 whether it was possible to get a nuclear deal.
Trump addressed a wide range of concerns in comments to the press before leaving the G7 meeting in Canada.
"PM Justin Trudeau acted so meek and mild", he tweeted. "Americans stand with you, even if our president doesn't". "Because these 6 countries represent values, they represent an economic market which has the weight of history behind it and which is now a true worldwide force".
He later wrote: "Tensions are growing everywhere". All three trading partners have threatened to retaliate with their own levies against US imports.
Cranberries and rice are mostly imported from key states that voted for Trump in the 2016 election.