BRUSSELS — After tense negotiations that went nearly to sunrise, European Union leaders signed off Friday on a migration deal intended to ease a political crisis, laying out new methods for curbing the flow of people coming to the continent and managing those who arrive.

Though the plan was short on details and faces many hurdles, the E.U. said it would push for the creation of centers — likely in Africa — where migrants could be screened for asylum eligibility. Such a step could further reduce the number of migrants who employ smugglers and attempt the dangerous journey across the Mediterranean Sea.

The deal reached at this two-day E.U. summit marks a compromise for a continent splintered over the migration issue and may help to preserve the tenure of German Chancellor Angela Merkel, who has been facing a rebellion over border security by members of her governing coalition.

“After intense discussion about this topic — which is perhaps the most challenging topic for the E.U. — it’s a good signal that we signed an agreement,” Merkel said. “Of course, now there are a great number of tasks that remain.”

In a move to ease the burden on front-line states such as Italy and Greece where most migrants arrive, the leaders also agreed that some European countries would establish centers within their own borders to process migrants who have arrived on the continent to seek asylum. Asylum seekers awarded the right to stay in Europe could be then resettled in other E.U. countries willing to host them.

Italy’s new populist government had refused Thursday to sign off on an earlier list of joint conclusions — which also touched on defense, trade and technology — in a tactic that set off the marathon negotiations.

“We are satisfied,” Italian Prime Minister Giuseppe Conte said early Friday. “From today, Italy is no longer alone.”

On June 29, French President Emmanuel Macron said European leaders had surpassed expectations and "found an agreement" addressing the migrant crisis. (Emmanuel Macron/Twitter)

But the E.U.’s latest ideas still face uncertainties, including how the E.U. would distribute refugees to member states and how it would treat those whose claims are rejected. The E.U. will look for volunteers to host the processing centers in Europe. Building such centers outside the continent will require delicate negotiations with African countries, which so far have signaled no interest in hosting such facilities.

The E.U. agreement on migration did not lay out any specifics about how a center in Africa might be operated, and how it would handle unaccompanied minors.

“There are so many unanswered questions about how it would work, whether it’s feasible, and whether they could uphold European standards,” said Imogen Sudbery, head of the International Rescue Committee’s Brussels office. “That is what has stopped this idea in the past.”

With Merkel trying to fend off a political insurgency and hard-line governments calling for tighter border restrictions, the migration issue took on an unusual urgency — even as the E.U. contended with Britain’s messy exit from the bloc and a tariff battle with the United States. Anti-migration leaders in Austria, Hungary, Poland and Italy have seized on the issue. Some have described a migrant “invasion,” even though arrivals from the Middle East and Africa have fallen dramatically.

So far this year, about 54,000 migrants have arrived in Europe — down about 94 percent from a similar six-month period at the end of 2015.

“If you can’t get people confident in a drop like that, I’m not sure any kind of external border control will get you much further,” said Elizabeth Collett, director of the Migration Policy Institute Europe.

Europe has stemmed the flow in part by boosting cooperation with Libya, a major jumping-off point for migrants, and by building up that country’s coast guard, which patrols the Mediterranean and regularly intercepts the dinghies and rafts bound for Europe. The E.U. said Friday that it would “step up its support” for the Libyan coast guard and other parts of the country. Other vessels in the Mediterranean, the E.U. said, must “not obstruct operations” of the Libyan coast guard.

But the E.U. has also drawn criticism for its cooperation with Libya, and migrants rescued by the coast guard are typically placed in notoriously brutal detention centers. Doctors Without Borders said Friday that E.U. governments are “abdicating their responsibilities to save lives and deliberately condemning vulnerable people to be trapped in Libya.”

While Italy pushed for greater support from its European counterparts, other leaders were not keen to revise European rules that require asylum seekers to be processed in the country where they first arrive.

Hungarian Prime Minister Viktor Orbán later agreed to sign the joint conclusions only if E.U. countries could participate on a voluntary basis in accepting migrants whose asylum requests had been granted.

Ahead of the summit, Merkel had warned that the crisis over migration could decide “the fate of the E.U.”

It could decide her fate, as well. Her interior minister, Horst Seehofer, had signaled that he would block asylum seekers at the Bavarian border if the chancellor could not strike some kind of immigration deal. If Seehofer split with Merkel on the migration issue, he could pull his Christian Social Union from the governing coalition, threatening Merkel’s 13-year run as Germany’s leader.

Fabian Virchow, a political-science professor at the University of Applied Sciences in Düsseldorf, said that Merkel can “sell as a success” the agreement, despite its vagueness.

“I don’t think [Seehofer] will escalate it to the point that the coalition of the two parties . . . will split,” Virchow said. “Because it’s hard to sell in light of what the E.U. leaders have agreed. They’ve made progress in the sense that Seehofer would support.”

Harlan reported from Rome. Luisa Beck in Berlin contributed to this report.