He praised Trump for his efforts to try to stop the flow of migrants and drugs from Mexico and said that liberalism "presupposes that nothing needs to be done. That migrants can kill, plunder and rape with impunity because their rights as migrants have to be protected".
The G20 leaders are meeting at a time of profound tensions over trade, globalisation and Iran's collapsing nuclear deal.
While prospects for detente in the trade war between the US and China are in the spotlight, many participating are calling for a broader perspective in tackling global crises.
Trump's meeting with the Chinese President today as the G20 meetings conclude has raised hopes for a detente in the tariffs war between the world's two largest economies.
But a Chinese foreign ministry spokesman in Beijing said China intends to defend itself against further US moves to penalise it over trade friction.
China often has sought to gain support for defending global trade agreements against Trump's "America First" stance in gatherings such as the G20.
Threats by Trump to impose more tariffs on Chinese exports "won't work on us because the Chinese people don't believe in heresy and are not afraid of pressure", Geng Shuang said.
Trump has at times found himself at odds with other leaders in such international events, particularly on issues such as Iran, climate change and trade.
Abe has sought to make the Osaka summit a landmark for progress on environmental issues, including climate change. French President Emmanuel Macron reinforced that message on Wednesday during a state visit to Tokyo, where he described climate change as a "red line" issue for endorsing a G20 communique.
On the rising tensions between Iran and the US, United Nations Secretary-General Antonio Guterres said the world can't afford the conflict and it was "essential to de-escalate the situation" and avoid confrontation.
Guterres also urged G20 leaders to take action on equitable and stable reforms to strengthen the global financial safety net and increase the global economy's resilience.
- AP