Fresh off announcing that he is running for president in 2020, former Housing and Urban Development (HUD) Secretary Julián Castro spared no time in calling out President Trump for his hardline immigration policies and the detention of immigrant families on the United States border with Mexico.

"He's a failed leader on this issue, and now he's just trying to stoke his political base by bringing up the wall all the time," Castro said on CBS’ "Face the Nation" Sunday. "And it's just a failure of leadership all around. I would end this kind of family detention."

JULIAN CASTRO, OBAMA'S EX-HUD SECRETARY, ANNOUNCES 2020 PRESIDENTIAL BID

Castro, a Mexican-American politician who previously served five terms as the mayor of San Antonio, countered that as president he would "make sure that we invest in sensible, smart and effective border security that includes personnel, that includes the smart use of technology and that does not scapegoat these immigrants but tries to look for a way that we can get to comprehensive immigration reform to fix our broken immigration system."

The Democratic presidential candidate added that Trump’s family separation policy has not deterred Central American migrants from coming to the U.S.

"Actually the exact opposite happened," he said.

At an event in San Antonio on Saturday, Castro announced his candidacy in a speech that touted his experience in the country’s seventh largest city as a testament of his leadership abilities and why he should make history as the country's first Latino president.

CLICK HERE TO GET THE FOX NEWS APP

He outlined climate change and universal healthcare as some of his main priorities.

Castro, who made stops in Iowa and Las Vegas days before his announcement, now joins what could be a crowded Democratic field. Senator Elizabeth Warren of Massachusetts launched an exploratory committee on Dec. 31. Former Vice President Joe Biden, California Senator Kamala Harris, and former El Paso Congressman Beto O’Rourke, whose profile has increased after narrowly losing to Senator Ted Cruz in November, have also been identified as potential candidates.

Rep. John Delaney of Maryland is already running for president, and Hawaii Rep. Tulsi Gabbard said in an interview Friday that she has decided to run for the White House.

Fox News’ Madeleine Rivera contributed to this report.