BEIRUT — Germany’s president said Monday that it was too early to repatriate Syrian refugees on a large scale and that the international community would have to continue to support the Middle Eastern nations that have hosted millions of them.

Frank-Walter Steinmeier, speaking from Lebanon where he met with President Michel Aoun, said “conditions aren’t right” in large parts of Syria to ensure the safe return of refugees.

Close to 1 million Syrian refugees are living in Lebanon, according to the U.N., amounting to over a fifth of the population. Lebanon’s government says with Damascus in control of large sections of Syria it is time to repatriate refugees.

Syria’s civil war still rages in parts of the country, including a large pocket just outside Damascus. Other parts of the country are stable, but suffered catastrophic damage from nearly seven years of fighting, and the country is struggling to attract funds for reconstruction.

“After many failed attempts at the international level…. we have not achieved a cease-fire” for Syria, Steinmeier said.

Earlier Monday, Steinmeier met with the German contingent of nearly 300 troops at an air base in northeastern Jordan. Germany carries out reconnaissance and refueling missions over Syria and Iraq, where IS once held large areas.

Steinmeier told soldiers that the battle against IS has been successful, but that their service is still needed to combat remnants of the extremist group and to keep them from resurrecting it.

He said soldiers told him they felt welcome and were working in good conditions.

“So the right choice was definitely made,” he said, referring to a decision last year to move the troops from Turkey to Jordan. Germany relocated the troops after Turkey restricted access to the soldiers, including visits by parliamentarians.

Steinmeier also visited the nearby Azraq camp, home to about 36,000 Syrian refugees.

He singled out Germany’s role supporting the refugees, saying a recent improvement in providing refugees with the essentials was partly due to significant aid from his country. Germany is the second largest donor country to Jordan, in terms of humanitarian and development aid, after the United States.

He also praised Jordan for hosting hundreds of thousands of refugees.

Asked about a series of restrictive Jordanian refugee policies, he said critics should keep in mind that the kingdom shoulders a disproportionately large burden.

“Yes, much can be improved,” he said. “Much needs to be done through international aid. But I believe it’s not justified to come with big complaints against Jordan.”

Jordan sealed its border with Syria in 2016, after a cross-border car bomb attack. The closure left tens of thousands of displaced Syrians stranded in harsh conditions in a remote area of the desert, with only intermittent access to aid supplies. Rights groups have also said that Jordan has forcibly deported hundreds of refugees.