Prime Minister Malcolm Turnbull has suffered a backlash in Queensland while losing ground in NSW and Victoria, according to a new analysis that reveals a powerful swing to Labor ahead of five byelections this month.

Voters have swung to Labor in every mainland state since the last election, putting Opposition Leader Bill Shorten and his party ahead of the government by 53 to 47 per cent in two-party terms.

The Fairfax/Ipsos results show the government’s support in Queensland in two-party terms has slumped from 54 per cent at the election to 48 per cent over the three months to the end of June.

Malcolm Turnbull has held his lead over Bill Shorten in every state as well as nationally. Credit:AAP

The results highlight the challenge for Mr Turnbull in the Queensland seat of Longman, where the government must defy the state trend to have any chance of winning the seat from Labor on July 28.