Former U.S. Secretary of Housing and Urban Development Julian Castro talks with an attendee during the Clark County Democrats' Steering Committee Meeting at Sierra Vista High School on January 08, 2019 in Las Vegas, Nevada.

Julián Castro will run for president, the former secretary of Housing and Urban Development announced on Saturday, joining an increasingly crowded field of contenders lining up to challenge President Donald Trump in 2020.

Before leading HUD under former president Barack Obama from 2014 to 2017, Castro served as mayor of his hometown of San Antonio. He has not held public office since departing the Obama administration but has stayed in public life, visiting early primary states New Hampshire and Iowa as well as releasing a memoir.

Invoking his family heritage, Castro — who named Joaquin, his twin brother who serves in Congress as his campaign chair — formally declared his candidacy in the city he once led.

"I'm running for president because it's time for new leadership, because it's time for new energy and it's time for a new commitment to make sure that the opportunities that I've had are available to every American," he told cheering supporters.

The 44-year-old Mexican-American is poised to appeal to an increasingly young and diverse Democratic party, at a time when President Donald Trump has ramped up his attacks on immigration at the southern border. Castro made the campaign announcement at Plaza Guadalupe on San Antonio's middle-class west side, less than 200 miles from the U.S.-Mexico border.

"When my grandmother got here almost a hundred years ago, I'm sure she never could have imagined that just two generations later, one of her grandsons would be serving as a member of the United States Congress and the other would be standing with you here today to say these words: I am a candidate for President of the United States of America," Castro said in a statement.

In a nod to the influence of the Latino vote, Castro said his first trip as a candidate will be to Puerto Rico, which is still struggling to recover from a massive hurricane that decimated the island. He plans to address the Latino Victory Fund and visit local residents, then will hit the stump in New Hampshire.

Castro is among the first Democrats to formally announce a presidential bid, but the primary field is expected to grow quickly. Elizabeth Warren, Bernie Sanders, and fellow Texan Beto O'Rourke are just a few of the prominent names expected to run. Warren has already started an exploratory committee and has visited the early primary state of Iowa.

Separately, Hawaii Democrat Tulsi Gabbard told CNN on Friday that she was also seeking the presidency.

--The Associated Press contributed to this article.