"There are hundreds of thousands of refugees now coming into Europe full of hope because they see Europe as an area of peace, justice and prosperity," Felipe said in a speech to the European Parliament in Strasbourg.
"We can't let these people down. We can't disappoint them. We have to be generous," the king said in a 30-minute speech that stressed the need to live up to the EU's democratic values.
"We have to show them solidarity and we have to be responsible in this situation," he added.
The king, whose country has put up fences to stop migrants entering its north African enclaves of Ceuta and Melilla, said Spain was ready to offer its expertise to the rest of the bloc in dealing with the problem.
"We have to work together as a whole European Union," he said reinforcing appeals from capitals like Berlin and Paris as well the EU's headquarters in Brussels.
German Chancellor Angela Merkel and French President Francois Hollande will also give a joint speech later to the parliament, the first of its kind since 1989, in a bid to present an image of solidarity at a time of deep divisions in the EU over migration.