BRUSSELS — The European Union has reached an agreement with Turkey that it hopes will ease the migrant crisis that has roiled the Continent for the past year.

Under the deal struck Friday, asylum seekers who take clandestine routes to Greece from Turkey are to be sent back, a significant step in the bloc’s effort to deal with the migrant exodus. The leaders of the 28 nations in the bloc and Prime Minister Ahmet Davutoglu of Turkey approved the accord over strenuous objections from humanitarian groups, who warned that the deal violated international law on the treatment of refugees.

The plan, which will take effect on Sunday, faces many challenges. There are many alternative routes into Europe, and it is unclear how effective the Turkish and Greek authorities will be at rounding up migrants who use boats to cross the Aegean and sending them back to Turkey. Turkey is also in the midst of its own security crisis, raising questions about the country’s ability to implement the deal and cope with the huge numbers of migrants on its soil.

The deal is the latest effort by the European Union to come up with a joint solution to the mass migration that has been straining its resources and roiling its politics. The idea is that it will deter migrants from trying to make dangerous journeys into Europe and encourage a legal path to Europe by offering to resettle at least some Syrians among the nearly three million migrants already in Turkey.