Housing and Urban Development Secretary Julian Castro addressing the Texas Democratic convention on June 17 in San Antonio. (Eric Gay/Associated Press)

Housing Secretary Julian Castro was long touted as a possible running mate for Hillary Clinton, but when the call came Friday informing him that the presumptive Democratic nominee had picked someone else, he wasn’t entirely surprised.

“It’s disappointing, of course,” Castro said in a telephone interview Saturday morning, “but it’s also easy to put into perspective. When I was 30 years old, I lost a very close mayor’s race. At the time I was completely disappointed and crushed. But a few years later I came back and I became mayor of San Antonio and it actually worked out for the better.”

Castro burst onto the national scene when he delivered a well-received keynote address at the 2012 Democratic convention. He then was still the mayor of San Antonio and soon after was talked about as a prospective vice-presidential nominee in 2016, a symbol of the rising importance of Hispanic voters and the key role they play in the Democratic Party’s coalition.

The talk continued when he moved to Washington and joined the Obama cabinet as housing secretary.

But two things changed over between the time he was first seen as a shortlist choice for vice president and the time Clinton made her selection.

One was the rise of Republican nominee Donald Trump and the effect of his candidacy on the Latino vote. Trump’s harsh words toward Mexicans and his stance on immigration appear to have put the Hispanic vote even further out of reach for the GOP.

Along with Castro, Clinton had looked seriously at Labor Secretary Thomas Perez as a possible running mate. But for Clinton, choosing a Hispanic seemed less vital with Trump doing plenty to motivate Hispanic voters to support the Democrat.

The other change was the rise of terrorism and security as prominent issues in the campaign. That changed Clinton’s thinking, according to multiple sources, about what she wanted in a running mate. She told Castro as much when the two met at her home on July 15 in Washington, according to someone who had knowledge of the conversation.

“She said that in the last year, what had happened in San Bernardino and Orlando, what had happened overseas, had influence how she was thinking about this election — that they were heading in the direction of taking someone with national security and foreign policy experience,” said this person, who declined to be identified to share what was known about a private conversation.

In his Saturday telephone interview with The Washington Post, Castro said he had no doubt that Clinton will receive the overwhelming share of the Hispanic vote, even without a Latino on the ticket.

“I believe that Hillary Clinton has a broad vision for America and that the Latino community is very much a part of that vision,” he said. “I’m confident she will get strong support.”

He added: “In the years to come there will be a Latino or Latina president. I believe that’s going to happen in due time. I hope to be alive to see it and I’m very confident that my kids will.”

He said the process of being considered was unique in his experience. “It’s certainly something quite different from the usual course of affairs, particularly for someone going through it for the first time,” he said. “It’s this odd in-between world — being talked about a lot, but really the process goes on within the privacy of the campaign. That’s certainly an odd dynamic you don’t usually know in politics.”

He also called the process “very well done, very professionally done process. I give the campaign tremendous credit for the discipline and how thorough they were."

Castro got the official word Friday night that he would not be Clinton’s choice from campaign chair John Podesta. By Saturday morning, he was looking forward to the Democratic National Convention in Philadelphia, where his twin brother, Rep. Joaquin Castro (Tex.) will speak, and to whatever the next chapter brings him.

“I can see that in life the road turns, and you don’t know how things are going to work out, and that often times things can work out for the better,” he said. "So I’m looking forward to the years ahead. I got into public service because I felt very blessed with opportunity. I want to make sure that others have that same opportunity. Wherever I'm at, I’m going to find ways to do that.”