The Senate voted 71-26 on Wednesday to confirm San Antonio Mayor Julian Castro to head the Department of Housing and Urban Development.
All 26 no votes came from Republicans.
"Julian has lived the American dream in his own life, and I'm confident he will help Americans across our country seize their own piece of that dream for themselves and their children," President Obama said in a statement after the vote.
Obama nominated Castro, a Hispanic and a rising star in the Democratic Party, to the job in May. As NPR's Scott Horley reported, he takes over the department at a time "when the nation's housing market has been treading water."
Castro, 39, succeeds Shaun Donovan, who was tapped to be White House budget chief. Castro rose to national prominence as the keynote speaker at the Democratic convention in 2012.
NPR's Frank James noted at the time:
"A graduate of Stanford University and Harvard Law School (like his twin brother, Joaquin, a Texas state representative), Castro became the youngest mayor of a top 50 U.S. city in 2009.
"That, among other achievements, long ago put Castro on the radar of some of the keenest political observers as a local politician with national potential."