Obama called Castro an "all star" among American mayors, a "leader in housing and economic development."
One of the nation's most prominent young Latino politicians, Castro, 39, delivered a keynote speech at the Democratic National Convention in 2012, the same year his twin brother, Joaquin, was elected to Congress.
The nominations are part of a Cabinet shuffle prompted by the decision of Health and Human Services Secretary Kathleen Sebelius to step down. Obama has nominated Sylvia Mathews Burwell, director of the Office of Management and Budget, to replace Sebelius.
Castro's selection comes as the White House prepares for its last chance before the midterm election to pass an immigration overhaul and as reform advocates pressure the president to take action on his own to reduce deportations. By placing Castro in such a high-profile position, Obama brings to his team a prominent new advocate, one with a compelling family story whose American chapter began with a grandmother who emigrated from Mexico.
"She worked as a maid, worked as a cook, worked as a baby sitter — whatever she had to do to keep a roof over her family's head," Obama said, telling the story Friday. "And that's because, for her and generations of Americans like her, a home is more than just a house. A home is a source of pride and security, a place to raise a family and put down roots and build up savings for college or a business or retirement, or write a lifetime of memories.
"Maybe one day," he continued, "the kid grows up in that home and is able to go on to get a great education and become the mayor of San Antonio and become a member of the president's Cabinet."
"Julian vivido el sueno Americano," Obama said, explaining that his nominee has lived the American dream.
Castro will leave during his third term as mayor. If confirmed by the Senate, he will become the second San Antonio mayor to hold the job. Henry Cisneros led the city for eight years before President Clinton named him to the top job at HUD.
Castro promised Obama that he would help his administration "ensure that we do housing right, and that because of it, more Americans achieve their dreams."
Donovan worked on housing policy in the Clinton White House, as well as for former New York City Mayor Michael R. Bloomberg. If confirmed, he would take his new position as the president's team, mostly hamstrung in its dealings with Congress, turns to its executive powers to implement Obama's vision.
Donovan said he would miss HUD but looked forward to working with like-minded colleagues.
"I'm known around the office as a numbers guy, and at HUD I often hear groans when I ask to see a spreadsheet that someone is holding at a meeting," he said. "If confirmed, I'll be glad to go to a place where my love of spreadsheets will finally be embraced."