(Adds comments from Castro in San Antonio, Obama)
WASHINGTON, July 9 (Reuters) - The U.S. Senate on Wednesday confirmed Julian Castro to lead the Department of Housing and Urban Development, placing the San Antonio, Texas mayor at the top of the agency in charge of housing during a sluggish recovery in the sector.
Castro, a Democrat who was nominated by President Barack Obama, was confirmed on a roll call vote of 71 to 26 in the Democratic-led Senate. The 26 senators opposed to his nomination were Republicans.
"We will allow more responsible Americans to achieve the dream of home ownership," Castro told a news conference, thanking the Senate for its bipartisan support.
He said he will resign his post as mayor of the seventh most populous U.S. city when a new mayor is selected by the city council, which should be in the next two weeks.
Castro will replace Shaun Donovan, who has been tapped to lead the White House's Office of Management and Budget.
Castro, who has the backing of industry groups such as the Mortgage Bankers Association and National Association of Realtors, has been praised for his housing and development programs in San Antonio, including revitalizing its downtown.
He is expected to push the Obama administration's plan to shutter mortgage finance giants Fannie Mae and Freddie Mac, an effort that has so far stalled in Congress.
"Julián 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," Obama said in a statement.
Some Democrats see Castro, a Latino, as a rising star in the party, and his new position puts him a step closer to a potential 2016 vice presidential run.
A graduate of Stanford University and Harvard Law School, Castro, 39 became the youngest mayor of a major U.S. city when elected in May 2009. He gained national prominence when he delivered the keynote address at the 2012 Democratic National Convention.
Castro told lawmakers during his first nomination hearing in June the current U.S. housing finance system was not working well for Americans and that he would support their reform efforts.
He said he would ensure taxpayers would not be on the hook again if another housing crisis struck, as they were when the government rescued Freddie Mac and Fannie Mae in 2008.
Castro also said he would ensure the Federal Housing Administration, a troubled government mortgage insurer under HUD that was forced to take $1.7 billion in taxpayer funds last year, would not need another rescue.
As the top U.S. housing official, he would be tasked with making homeownership more affordable for low-income buyers.
The FHA, which aims to help first-time and low-income borrowers, raised its mortgage insurance fees to bolster its finances. That action locked out thousands of potential buyers, and it now faces pressure to bring the fees down.
Castro told lawmakers it was possible to balance FHA's mission of helping low-income borrowers with the need to keep it financially sound.
"My perspective, whether it relates to the requirements for down payments or other measures, is that we achieve this balance to stay within the mission of the FHA - the historic mission to ensure that first-time home buyers, that folks of modest means who are creditworthy, that they have the opportunity to reach the American dream of homeownership," Castro said last month. (Reporting by Elvina Nawaguna; Additional reporting by Jim Forsyth in San Antonio; Editing by Paul Simao and Eric Walsh)