Estimated net migration to the UK reached a record 336,000 in the year to June, Office for National Statistics (ONS) figures have shown.

The figure - the difference between the number of people arriving and leaving - was 82,000 more than the previous year.

Jay Lindop, from the ONS, said the majority of people over the last year came to the UK for work or study.

The government said it highlighted the challenge to reduce net migration to "sustainable levels".

Downing Street aims to get net migration down to five figures by 2020.

UKIP leader Nigel Farage said the statistics showed the government's "complete failure to control immigration" and urged people to vote to leave the EU in the "in/out" referendum expected by the end of 2017.

The net migration figure was also higher than the last provisional data, which showed the index at what was then a record 330,000 in the 12 months to March. This has since been revised up to 336,000 as well.

The ONS data revealed that:

Net migration of European Union (EU) citizens showed an increase of 42,000 to 180,000, with the number from countries outside the bloc also up 36,000 to 201,000

In all, 294,000 people migrated to the UK for work, two thirds of whom had a definite job

The number of EU nationals working in the UK stood at two million from July to September, an increase of 324,000 compared to the same quarter last year

A total of 50,000 Romanians and Bulgarians came to the UK in the year to June, a rise of 19,000; restrictions on citizens from the two countries working in the UK were lifted in January last year

Romania is now in the top five countries where those coming to the UK last lived for the first time, accounting for 6% of all immigration

Ms Lindop, head of population statistics at the ONS, said the latest net migration figure "remains the highest on record".

Meanwhile, separate Home Office figures revealed the number of people claiming asylum in the UK has reached its highest level for 12 years.

Applications between July and September totalled 10,156 - the highest number for any three-month period since 2003 and a 64% rise on the previous three months

Total applications in the 12 months to September were 29,02 - up 19% on last year

The highest number were from Eritrea (3,726), followed by Sudan (2,842), Iran (2,407) and Syria (2,402). Some 162 people were resettled under the Syrian Vulnerable Persons Relocation Scheme in the 12 months up to September

UK urged to show more compassion for Syrian refugees

Analysis

Image copyright PA

By Danny Shaw, home affairs correspondent, BBC News

The release of the immigration statistics, every three months, is a day the Home Office must dread.

Since the end of 2012, net migration has being going up almost continuously. Net migration, of course, is the key figure we look for because the government is aiming to bring it down to below 100,000 by 2020.

It failed to do that by the general election in May, and, to much surprise, decided to stick with the target when critics were saying it was unachievable and should be dropped. A lot can happen in four and a half years of course, but it's hard to see how it can do it.

Emigration is broadly stable, and immigration is at record levels and rising from both EU and non-EU countries.

If ministers are to reach their goal, they'll have to reduce the so-called "pull factors". That's tough when one of the biggest attractions of the UK is its relatively buoyant economy and the prospect of work.

The ONS said the rise was due to a 62,000 increase in immigration to 636,000 and a 20,000 reduction in emigration to 300,000.

More than two thirds of the immigration increase was driven by EU citizens, the majority of whom came to Britain to work.

Immigration minister James Brokenshire said the government was committed to reforms "across the whole of government" to deliver "the controlled migration system".

"Our new Immigration Bill will address illegal working, the pull factors that draw migrants to Britain and the availability of public services which help them to remain here unlawfully," he said.

"The last two set of figures show record levels of EU immigration which show why the prime minister is right to negotiate with the EU to reform welfare to reduce the financial incentives that attract EU migrants to the UK."

The Migration Observatory at the University of Oxford said asylum remained "the smallest component" of UK immigration "by some distance".

Director Madeleine Sumption said migration for work and study were "the largest categories" and said changes in net migration were "mainly being driven" by economic factors like the success of the UK economy rather than by new policies.

Alp Mehmet, vice chairman of Migration Watch UK, said the figures were "very disappointing" and warned "the pressure on our infrastructure will intensify" if the numbers continued to rise.