The Grenfell Tower fire highlighted “the disastrous effects of austerity”, Jeremy Corbyn told Theresa May during a sometimes noisy first prime minister’s questions since the general election.

In exchanges dominated by the west London blaze, which killed at least 79 people, the Labour leader said the tragedy must be “a wake-up call” for the government after years of cuts to council funding.

May rejected Corbyn’s argument, saying towers had begun to be clad in unsuitable insulation and panels before the Conservatives re-entered government in 2010, and that a Labour administration was first to relax housing inspection rules.

May said that test samples of cladding from 120 blocks in 37 local authority areas had not met fire safety standards – a 100% failure rate – and argued that the scale of the problem meant parties should come together over the issue.

Corbyn, buoyed by a better-than-expected Labour result in the 8 June election, in which May lost her Commons majority, devoted all his questions to the fire, and challenged the prime minister when she said the background to the tragedy was still to be discovered.

“I think I can help the prime minister with this issue,” he said. “When you cut local authority budgets by 40% you end up with fewer building control inspectors.”

Speaking amid jeers from the opposition benches, which prompted the Speaker to intervene, Corbyn said: “When you cut local authority budgets by 40% we all pay a price in public safety – fewer inspectors, fewer building control inspectors, fewer planning inspectors, we all pay a price.”

Other cuts had led to 11,000 fewer firefighters, while the public sector pay cap had affected recruitment and retention, the Labour leader said.

“What the tragedy of Grenfell Tower has exposed is the disastrous effects of austerity, this disregard for working-class communities, the terrible consequences of deregulation and cutting corners,” he said.

“I urge the prime minister to come up with the resources needed to test and remove cladding, retrofit sprinklers, properly fund the fire service and police, so that all our communities can truly feel safe in their own homes. This disaster must be a wake-up call.”

May responded by outlining what she said was the longer-term political background to the cladding issue. “The cladding of tower blocks did not begin under this government,” she said. “It did not start under the previous coalition government. The cladding of tower blocks began under the [Tony] Blair government.”

May said that fire regulations were changed in 2005, again under Blair’s Labour government, which meant inspections no longer had to be carried out by the fire service. The following year, rules were relaxed and the responsibility passed to councils.

“That is why I say to the right honourable gentleman, this should be an issue that across this house we recognise is a matter that has been developing over decades,” May said.

“It is a matter that has occurred under governments of both colours, under councils of all political persuasions and is something that I would hope we would say we should come together and ensure that we get to the answers over why this has happened over many years, what has gone wrong, and how do we stop it from happening in the future.”

Asked by Corbyn whether she could say if the external cladding used on Grenfell Tower was compliant with fire regulations, May said it appeared not to be, but stressed there seemed to be “a much wider issue here”.

She said: “As we have seen, the number of buildings where the cladding has failed the combustibility test, from those samples that have been sent in already from local authorities and housing associations, this is a much wider issue.

“It is an issue which has been continuing for many years, for decades, in terms of cladding being put up in buildings. There are real questions as to how this has happened, why it happened and how we can ensure that it doesn’t happen in the future.”

Given this, May said, the public inquiry would need to “look much more widely at the problem”.

She said: “We need to get to the bottom of it, and that’s what we’re going to do.”