US President Donald Trump has asked Hamas militants to immediately release all hostages held in Gaza in what he called his "last warning" to them.