Image copyright PA Image caption There is fierce competition among construction firms in the EU

The EU has passed a law requiring firms to comply with local standards when they post workers temporarily to another EU country.

The revised rules adopted by the European Parliament mean posted workers will be entitled to the same level of pay as their local counterparts.

In France, the UK and Germany there have been complaints of unfair competition from cheaper eastern European labour, said to undercut locals.

It was an issue for the Brexit lobby.

Brexit campaigners argued that EU freedom of movement was undermining British workers in sectors such as construction and food processing, with some firms cutting costs by importing workers from the newer EU states, such as Poland and Romania.

Many firms, however, argue that they hire foreign workers for jobs that Britons cannot fill, for lack of the necessary skills.

Under the new rules, firms sending workers to another EU country will have to cover their travel, board and accommodation costs - not deduct those costs from the workers' salaries.

The accommodation provided will have to meet local standards.

The duration of the posting has been set at a maximum of 12 months, with a possible extension of six months. Beyond that period, a worker who stays on will have to be governed by the host country's labour rules.

Read more on related topics:

The 28 EU member states now have two years to transpose the rules into national law.

It is the culmination of years of EU wrangling over the issue. Many politicians argued that the sense of injustice over posted workers was fuelling hostility towards the EU.

Dutch Socialist MEP Agnes Jongerius, one of the leading lawmakers involved, called it "an important step towards creating a social Europe that protects workers and stops companies from engaging in a race to the bottom - a Europe that does not cut corners and that looks out for ordinary, working people".

According to the European Parliament, in 2016 there were 2.3 million posted workers in the EU, and posting increased by 69% between 2010 and 2016.