Sajid Javid has pledged the government will back a move to protect the rights of EU citizens if there is a no-deal Brexit – a day after Theresa May dismissed it.

The home secretary stunned and delighted a committee of MPs by saying there was “nothing” wrong with the amendment, tabled by a Tory MP.

However, he was blindsided when told the government had suggested it would fight the amendment, saying: “When did you hear that? From who.”

When told it had been the prime minister, Mr Javid replied: “Did you – right, ok”, before adding: “I’m perfectly happy with that amendment.”

Tabled by Alberto Costa, a ministerial aide, it is designed to be attached to be attached to the latest Brexit motion being debated by MPs today, amid the continuing crisis over EU withdrawal.

It demands that, even if there is no-deal, the citizens' rights part the withdrawal deal is carved out and approved as a separate treaty, to ensure millions of people are not left high and dry.

When Jeremy Corbyn urged the prime minister, on Tuesday, to accept the amendment, the prime minister suggested it was pointless, because the rights of British ex-pats were a matter for individual EU countries.

Brexit deal vote: Opposing groups of protesters gather by parliament Show all 20 1 /20 Brexit deal vote: Opposing groups of protesters gather by parliament Brexit deal vote: Opposing groups of protesters gather by parliament Brexit supporters outside parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester adjusts her pro-EU wig AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament A message to Jeremy Corbyn in support of a people’s vote Getty Brexit deal vote: Opposing groups of protesters gather by parliament A mock Titanic captained by Theresa May heads towards an iceberg in a stunt by campaigning group Avaaz AP Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters outside parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides are in close contact outside of parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament Paintings of Theresa May and Jeremy Corbyn Getty Brexit deal vote: Opposing groups of protesters gather by parliament Former Ukip leader Nigel Farage speaks to the media at the protests outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament A pro-Brexit protester in Parliament Square Getty Brexit deal vote: Opposing groups of protesters gather by parliament Opposing protesters share the space outside parliament Getty Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester holds EU balloons outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters stand on Westminster Bridge PA Brexit deal vote: Opposing groups of protesters gather by parliament Former Ukip leader Nigel Farage speaks to the media at the protests outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters demonstrate outside the Houses of Parliament EPA Brexit deal vote: Opposing groups of protesters gather by parliament A pro-Brexit protester sets up outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament An Avaaz campaigner holds a People’s Vote life float Reuters Brexit deal vote: Opposing groups of protesters gather by parliament A demonstrator holds a sign advocating a no-deal Brexit outside parliament AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester waves an EU flag on Westminster Bridge PA Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides demonstrate outside parliament AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides stand near parliament Reuters

Ms May has already promised to protect the 3.2m EU citizens in this country – although they are seeking the stronger guarantee offered by the Costa amendment.

“The EU does not have the legal authority to do a separate deal on citizens’ rights without a new mandate,” the prime minister told MPs.

But Mr Javid, giving evidence to the Commons home affairs committee, said the amendment was “trying to find more ways for parliament to give that reassurance, which we both agree is very important”.

He acknowledged it required Brussels to shift its stance, but added: “I think it’s a reasonable question to ask.”

During the evidence session, Mr Javid was criticised over:

* The “shambles” of the settlement scheme for EU citizens, amid fears that many will fail to register by the deadline, which threatened “Windrush all over again”.

* A failure to provide figures for the number of boats attempting to bring migrants across the Channel in recent months.

* His refusal to discuss the case of Shamima Begum, the London teenager who travelled to Syria to join Isis, who was stripped of her citizenship – despite no legal bar on him doing so.