The retired neurosurgeon who previously declined to serve in Donald Trump’s cabinet due to his lack of experience has been nominated as US housing and urban development secretary.

Ben Carson, who quit the presidential race last March, “has a brilliant mind and is passionate about strengthening communities”, said Mr Trump in a statement.

“We have talked at length about my urban renewal agenda and our message of economic revival, very much including our inner cities. Ben shares my optimism about the future of our country and is part of ensuring that this is a Presidency representing all Americans. He is a tough competitor and never gives up.”

Mr Carson, who endorsed Mr Trump after quitting the race himself, is the first African American to be nominated to the president-elect’s cabinet. His role will be to oversee programs that administer mortgage insurance, deal with rental subsidies to lower income families, as well as formulate policy on homelessness and housing discrimination.

“Ben shares my optimism about the future of our country and is part of ensuring that this is a presidency representing all Americans,'' the statement from Mr Trump said.

His appointment needs to be confirmed by the US senate. It is one of more than 4,000 positions that the Trump transition team needs to fill.

Ben Carson becomes aggravated in Katty Kay interview

In November last year, Mr Trump accused Mr Carson of having “a pathological disease” and compared the surgeon to a child molester, saying there was “no cure” for his alleged condition.

“I'm not saying anything other than pathological is a very serious disease. And he said he's pathological, somebody said he has pathological disease,” Mr Trump told CNN.

“You don't cure these people. You don't cure a child molester. There's no cure for it. Pathological, there's no cure for that.”

Mr Trump has also mocked Mr Carson for suggesting Egyptian pyramids were used for storing grain.

Mr Carson's name was previously attached to other cabinet positions, including health and human services secretary. Mr Carson and his spokesman, Armstrong Williams, said last month that Mr Carson would feel “like a fish out of water” if he were to run a government agency.

On Facebook last week it appeared the pastor had changed his mind.

“After serious discussions with the Trump transition team, I feel that I can make a significant contribution particularly to making our inner cities great for everyone,” he wrote.

Donald Trump's controversial cabinet

“We have much work to do in strengthening every aspect of our nation and ensuring that both our physical infrastructure and our spiritual infrastructure is solid.”

Mr Trump has frequently lamented the state of “inner cities”, where he said people fear being shot just walking down the road. His focus on inner cities ran in parallel with his frequent call to reinstate “law and order” and his pitch to woo African American voters shortly before the election.

“What the hell do you have to lose?” he asked in Ohio.