Spain said Monday it is willing to take in five inmates from the U.S. prison in Guantanamo Bay, not just the two it had announced last month.

Foreign Minister Miguel Angel Moratinos told breakfast meeting with reporters that the inmates will not pose a security threat.

The transfers, he said, "will be done with all the legal guarantees so as to defend the security situation that our country requires."

He said the nationalities of the former prisoners would be announced when they arrive in Spain. Officials have said previously that Spain had agreed to accept one Yemeni and one Palestinian.

A Foreign Ministry official said later those two are still due to come to Spain and the government is now studying the background of other inmates at the U.S. prison for terrorism suspects in Cuba.

The spoke on condition of anonymity in line with ministry rules. He said it is not yet known when Spain might give final approval for the transfers.

In Washington, State Department spokesman Gordon Duguid told reporters Tuesday that it would be a "positive move" if Spain were to accept five detainees. He commended allies and friends willing to accept inmates, saying such cooperation would help Obama's goal of closing down the prison.

Other European countries that have agreed to take in Guantanamo inmates include France, Hungary, Ireland, Italy and Portugal. Most have agreed to take in one or two, or three at most.

President Obama had pledged to close the Guantanamo prison in January of this year but missed that deadline.

His special envoy for this task, Daniel Fried, met with Spanish officials in Madrid in June and asked Spain to take in four prisoners. From the outset, Spain has been receptive.

Prime Minister Jose Luis Rodriguez Zapatero has been eager to establish good ties with the United States and Obama, after angering then-president George Bush in April 2004 by withdrawing Spanish peacekeepers from Iraq.

Zapatero has also agreed to send more Spanish troops to Afghanistan in response to a plea from Obama for more allied help in fighting the Taliban.