The deal comes after Lithuania asked fellow EU member states for assistance against illegal migration.