Julián Castro, the former housing secretary and former mayor of San Antonio, announced on Saturday that he would run for president, one of the most high-profile Latino Democrats ever to seek the party’s nomination.

His first campaign stop will be in Puerto Rico, where he will speak on Monday at the Latino Victory Fund’s annual summit and meet with residents still struggling to recover from Hurricane Maria. Later in the week, his campaign said, he will go to New Hampshire.

“When my grandmother got here almost a hundred years ago,” Mr. Castro said at the Plaza Guadalupe amphitheater in San Antonio, in the neighborhood where he was raised. “I’m sure that 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.”

Mr. Castro’s announcement had been expected for several weeks. He established an exploratory committee in December, two months after publishing a memoir, “An Unlikely Journey” — a familiar path for presidential candidates who want to play up their life stories and qualifications and, perhaps, get ahead of their biggest vulnerabilities. This month he also visited two of the early caucus and primary states, Iowa and Nevada.