The chief inspector of schools has delivered a sharp warning to the government that the opening of more grammar schools would be “a profoundly retrograde step” that would damage the prospects of disadvantaged children.

In a last-ditch attempt to influence government policy, Sir MichaelWilshaw, who steps down from his role as head of the schools watchdog, Ofsted, in December, said grammar schools’ record on admitting children from poorer backgrounds was “pretty woeful”.

He said that rather than boosting social mobility, selective education worked against the poorest children who were just starting to benefit from education reforms introduced first by Labour’s Tony Blair and later by the former education secretary Michael Gove.

Wilshaw has been a longtime critic of grammar schools, but his strongly worded speech at a London Councils education conference on Monday will be seen as a direct rebuke to prime minister Theresa May’s reported support for selection in schools.

The education secretary, Justine Greening, has said she is keeping an open mind on grammars. Reports have indicated however that the government may sanction the opening of selective schools in poorer areas in an effort to improve social mobility.

Wilshaw told the conference the success of schoolchildren in London, particularly those from disadvantaged backgrounds who outperform their counterparts elsewhere, challenged the narrative surrounding grammar schools.

“If grammar schools are the great answer, why aren’t there more of them in London?” he said. “If they are such a good thing for poor children, then why are poor children here in the capital doing so much better than their counterparts in those parts of the country that operate selection?

“I appreciate that many grammar schools do a fine job in equipping their students with an excellent education. But we all know that their record of admitting children from non-middle-class backgrounds is pretty woeful. The notion that the poor stand to benefit from the return of grammar schools strikes me as quite palpable tosh and nonsense – and is very clearly refuted by the London experience.”

England has 164 state-funded fully selective schools, while Northern Ireland has 69. A ban on new grammars has been in place since the Blair administration, but there is widespread support for greater selection from backbench Tories.

The ban was undermined by the former education secretary Nicky Morgan who gave the go-ahead last October for the opening of a new grammar school in Kent, which won approval because it claimed to be a satellite of an existing school rather than a new selective institution.

At the time May made clear her support for moves in her own Maidenhead constituency to open a similar satellite grammar school. Since she became prime minister, Downing Street has done nothing to dampen speculation that an extension of selection in schools is on the agenda. An announcement could be made as early as the Tory autumn party conference.

Wilshaw, who is due to leave his post after five years, told Monday’s conference the gap in attainment at GCSE level in Hackney between children on free school meals and those on non-free school meals was 14.6%. In Kent, which operates selection, the gap is nearly 34%.

“A grammar school in every town, as some are calling for, would also mean three secondary moderns in every town – a consequence rarely mentioned,” Wilshaw said. “That is why I am in no doubt that a return to selection would be a profoundly retrograde step that would actually lead to overall standards sliding back, not improving.”