BRUSSELS — The European Union agreed on Monday to launch a new naval and air mission to stop more arms reaching the warring factions in Libya, overcoming initial objections from Austria and Hungary, which feared the ships might attract migrants and enable more of them to reach Europe.

The decision by foreign ministers was a victory for the new European foreign-policy chief, Josep Borrell Fontelles, who has criticized the need for unanimity among all member states to make decisions on foreign and security policy.

The new mission will be limited to the eastern Mediterranean, where most arms smuggling to Libya takes place, away from the routes most migrants take to try to reach Europe from chaotic Libya. The agreement satisfies the objections of fiercely anti-immigrant nations like Austria and Hungary, which have moved sharply to the right in recent years.

Mr. Borrell had warned that the European Union could not stand idly by while nearby Libya was embroiled in civil war aided most recently by Russia and Turkey, which support opposite sides.