Julian Castro has launched his bid to become the US' first Hispanic president, emphasising a message of hope and diversity at a time when Americans are locked in angry debate over immigration and border security

"I am a candidate for president of the United States," the 44-year-old told a crowd in San Antonio's historic Guadalupe Plaza, during a speech that frequently invoked the immigrant heritage that brought his family to the US from Mexico.

Often called a rising star in the Democratic Party, Mr Castro, who was Barack Obama's housing secretary - and the youngest member of that cabinet - is expected to be part of a diverse field of candidates eager to challenge President Donald Trump.

At a time when the federal government has been partly shut down over Mr Trump's demand for funds to build a wall on the Mexican border, Mr Castro sounded a contrasting message.

He said San Antonio, a city that is nearly two thirds Hispanic, "represents America's future: diverse, fast-growing, optimistic.

"Yes, we must have border security, but there is a smart and humane way to do it. And there is no way in hell that caging children is keeping us safe," Mr Castro said.

"We say no to building a wall and say yes to building community," he added, to roars from the crowd.

Mr Trump wants the border wall to block illegal immigrants he has sought to equate with crime, drugs and gangs. 

"There is a crisis today - it's a crisis of leadership. Donald Trump has failed to uphold the values of our great nation," Mr Castro said.

Urging his supporters to look around the blue-collar neighbourhood where he grew up, Mr Castro said, "there are no front runners that are born here, but... with big dreams and hard work, anything is possible in this country."

He added that his grandmother Victoria would surely have been amazed when she arrived from Mexico in 1922 - she went on to work as a maid and a cook - had she known that one grandchild would end up in Congress and the other as a presidential candidate.

Julian Castro's twin brother Joaquin, who introduced him Saturday, is a congressman.