BEIRUT (AP) — The Hungarian government posted ads in Lebanese and Jordanian papers on Monday, warning migrants not to enter Hungary illegally, saying it is a crime punishable by imprisonment.

The move comes as Europe is reeling under pressure from tens of thousands of refugees making the perilous trek to the continent to seek sanctuary there.

In a terse statement published as a full-page announcement in several newspapers, including Lebanon’s leading An-Nahar and Jordan’s Al-Rai, the government of Hungary said that “the strongest possible action is taken” against people who attempt to enter Hungary illegally.

ADVERTISEMENT

“Do not listen to the people smugglers. Hungary will not allow illegal immigrants to cross its territory,” it said in both English and Arabic.

Lebanon, a country of around 4.5 million people, has over 1.1 million Syrian refugees, while Jordan, with a population of 6.5 million, has about 630,000 — some of whom have already shown readiness to migrate to Europe because of dwindling aid and work opportunities.

Hungary, which closed its border with Serbia on Sept. 15, has erected another steel barrier at the Beremend border crossing with Croatia to try to slow the flow but the migrants keep coming.

Many, fleeing violence and poverty in the Middle East, Asia and Africa, cross the Mediterranean in rickety smuggler boats and rush from one European border to the next to try to reach welcoming countries such as Germany and Sweden. The majority of those arriving on the shores of Europe are Syrians.

Hungary’s ads were not the first. Earlier this month, Denmark’s Ministry of Immigration, Integration and Housing posted advertisements in Lebanese newspapers aiming to deter migrants, saying that the Scandinavian nation has reduced social aid to migrants by 50 percent recently. Denmark also warned that migrants whose applications are rejected will be deported immediately.

Syria’s civil war, now in its fifth year, has killed more than 250,000 people and generated more than 4 million refugees.

Meanwhile in Lebanon, the education minister appealed to donors to remain committed to helping the country deal with the flux of refugees, including providing free schooling to hundreds of thousands of refugee children currently here.

Elias Bou Saab said his government would absorb more Syrian refugee children in schools this year, aiming to double those enrolled from last year to reach 200,000. But this, he warned, leaves roughly the same number — about 200,000 — still without schooling.

“There are a still a great number of students out of schools, and that is a danger, danger to Lebanon and to the region,” Bou Saab told reporters as he launched the Back to School campaign, for which the government raised $94 million in grants — $25 million short of the needed funds.

“When they lose hope that there is no job opportunity or chances to go to school or chances that give them hope in life, they start to look for legitimate and illegitimate ways to go from one place to another,” he added, referring to the exodus to Europe.

Tonya Chapuisat, the UNICEF representative in Lebanon, said the Lebanese government has the school capacity to absorb more children but needs long-term donor commitment to do so. “If there was funding, we would hope that would go up to 300,000” students, she told The Associated Press.

Meanwhile, German vice chancellor urged the international community to increase aid to Mideast countries hosting millions of Syrian refugees, saying this is key to slowing migration to Europe.

Sigmar Gabriel, who was to start a visit to Jordan on Monday, said wealthy Gulf states “aren’t paying” and suggested the United States could contribute more. Aid agencies requested $7.4 billion for the Syria crisis for 2015, but received only 38 percent.

Gabriel told German TV on Sunday that the situation in host countries is “dramatically bad.”

___

Associated Press writers Bassem Mroue in Beirut, and Karin Laub in Amman, Jordan, contributed to this report.