The European Union has given the final green light to a landmark overhaul of its migration and asylum policies that will see hardened borders and shared responsibility among member states, as campaigning heats up for Europe-wide elections next month.

The New Pact on Migration and Asylum was officially approved by the 27-nation bloc’s economy ministers, ending more than eight years of work to rewrite the rule book for handling people who enter Europe without authorisation.

A majority of member nations backed the reform’s 10 pieces of legislation, ensuring its passage despite opposition from Hungary and Poland, which have long rejected the idea that all European countries should take in a share of arrivals.