Retired neurosurgeon Ben Carson was confirmed by the Senate Thursday to become housing secretary in the Trump administration.

Carson, a former Republican presidential candidate who battled Trump for the GOP nomination, was confirmed for the Cabinet position by a 58 to 41 vote.

In his role as head of the Department of Housing and Urban Development, or HUD, Carson will lead more than 8,300 employees and handle an annual budget of nearly $47 billion.

The vote comes more than a month after Carson earned the bipartisan backing of the Senate Banking, Housing and Urban Affairs Committee, even gaining the support of two of the panel’s most liberal members -- Democrats Sherrod Brown of Ohio and Elizabeth Warren of Massachusetts.

Warren, however, switched her position and voted against Carson on Thursday. The vote change comes after she faced pressure from liberal activists and wrote a long Facebook post defending her support of Carson.

Answering critics who questioned his qualifications to run HUD, Carson said during his January nomination hearing that he would go on a “listening tour” so he could gain feedback on how to reform the massive and complex department.

During his Senate hearing, Carson said he wanted to focus on solutions to combat the lack of available low-income housing and to forge new partnerships between government and the private sector.

“There’s a lot of money in the private sector. There’s a lot of good will in the private sector,” said Carson.

As secretary, Carson committed to examining “those programs that are working so we can multiply them across the country.”

Underscoring the challenges he faces at HUD, the National Low Income Housing Coalition released a report on Thursday that found a shortage of 7.4 million affordable and available rental homes for extremely low-income households.

In addition, the report said 71 percent of extremely low-income households spend more than half of their income on housing.

The Associated Press contributed to this story.