LONDON — Prime Minister Theresa May of Britain moved swiftly to replace Amber Rudd as home secretary on Monday, promoting Sajid Javid, a son of Pakistani immigrants, in a move that made him the first nonwhite politician to hold one of the most senior British cabinet positions.

Ms. Rudd quit late Sunday, amid a growing chorus of criticism over her handling of a damaging immigration crisis involving migrants from the so-called Windrush generation, named for a passenger liner that carried many people from the Caribbean to Britain decades ago.

Mr. Javid, who moved from his job as secretary of state for housing, communities and local government, faces the urgent task of quelling the scandal affecting some of those who came from former colonies to help rebuild postwar Britain but were in recent years declared illegal immigrants, despite having lived in the country for decades.

Mr. Javid, 48, whose parents arrived in Britain in the 1960s, is the first black, Asian or ethnic minority person to hold the post of home secretary, and his appointment may reassure some of the department’s critics. In particular, Mr. Javid has spoken of his personal concerns about the swirling crisis over the Windrush migrants.