Former housing minister who lost his London seat on Thursday will replace Nick Timothy and Fiona Hill

A former minister who lost his seat in the general election has been appointed Theresa May’s new chief of staff.

Gavin Barwell was ousted from his Croydon Central constituency as a result of Labour’s unexpectedly strong showing. The prime minister said that he would bring “considerable experience” to the post.

Barwell has the enormous task of stepping into the role that had been jointly held by Nick Timothy and Fiona Hill, May’s long-term political allies who resigned in the wake of the election result.

He was known as a campaigning MP on the moderate wing of the party, who was keen to improve the party’s vote among minority ethnic voters. He is widely liked by Conservative colleagues, in contrast to his predecessors.

“We live in a country where most people share our values but many won’t vote for us because they don’t think we’re on their side,” he wrote in 2012. “Our challenge is to change that perception. It is a challenge that we must rise to – for our party’s sake and for our country’s.”

He could scarcely be taking up the job at a more difficult time, with May’s premiership in serious peril. He must now help navigate her through the immediate task of working with the Democratic Unionist party to govern and help prepare her for Brexit talks that begin in just over a week.

The shock election result and the departure of her closest aides has forced May to act quickly before parliament returns this week. The move also shows an attempt to reach out to Tories who lost their seat after claims that May has failed to show contrition.

Barwell had been the housing minister in May’s administration before losing his seat. Sajid Javid, the communities secretary, described the move as “excellent appointment”.

In a statement, May said that Barwell “has been a first class minister and is widely respected”.

She added: “He will bring considerable experience of the party to the post. As I said yesterday, I want to reflect on the election and why it did not deliver the result I hoped for. Gavin will have an important role to play in that. I look forward to working with him.”

Barwell said: “I voted for Theresa May to become prime minister. I believe she is the best person to heal the divisions in our country that last year’s referendum and the general election have laid bare, getting the best Brexit deal for the whole country and leading us towards a brighter future outside the EU.

“I’m thrilled to have the opportunity to serve as her chief of staff.”