Julián Castro, who has been frustrated by the relative lack of attention paid to his campaign up to now, found his way to the spotlight Wednesday on the first night of the first Democratic presidential debate of the 2020 race.

Now he has to keep it.

Castro, who was housing secretary under President Barack Obama and the mayor of San Antonio before that, not only broke from the pack a bit but did so by hammering his fellow Texan on stage, former Rep. Beto O’Rourke, for whom Castro campaigned when O’Rourke ran for the Senate in 2018.

Lawrence Romo, who headed the Selective Service under Obama, organized a Democratic debate watch party in Castro’s hometown. He said when Castro began hammering on immigration and O’Rourke, there were cheers and applause in the bar and restaurant.

“There was more excitement when he showed command in his voice and passion and compassion, which I think you need to have as president, so he really helped himself out,” Romo said.

In a post-debate flash poll conducted by the progressive group Indivisible, Castro came in second after Sen. Elizabeth Warren of Massachusetts. In an MSNBC focus group, some said the big surprise for them on the night was Castro.

Amanda Renteria, who was Hillary Clinton's national political director in 2016, said, “It was incredibly smart for him to lean into immigration so much, especially given the news."

Renteria was referring to the drowning deaths of Oscar Martínez Ramírez and his toddler daughter, Valeria, and the image of their lifeless bodies lying facedown on the edge of the Rio Grande that had dominated the news cycle going into the debate.

“Tonight was the night to do what he did, and he made this so personal,” she said.

Castro was the first candidate to jump into the presidential race, announcing his campaign Jan. 12.

But he has been haunted by criticism that he is too measured, too polite and not tough enough to take on President Donald Trump. O’Rourke, on the other hand, won national media attention during his Senate run against Ted Cruz, the incumbent Republican, and proved to be a crowd pleaser, often delivering speeches from tabletops.

But during the debate, Castro turned the tables on O’Rourke, a native of El Paso, by pointing out that the latter wouldn’t endorse Castro’s proposal to make crossing the border a civil violation instead of a criminal misdemeanor.

Castro also pilloried O’Rourke on his grasp of immigration laws.

“I think that you should do your homework on this issue," Castro said. "If you did your homework on this issue, you would know that we should repeal this section."

On MSNBC's "Morning Joe" on Thursday, Castro explained why he had zeroed in on decriminalizing certain border crossings. “I just wanted to point out that if you’re not calling for the repeal of the section, that means that basically you’re going to keep the status quo and you’re going to allow family separation.”

Castro has not shied from pushing immigration to the top of his agenda, even though his experience in the federal government is in housing, and television host Bill Maher and others have questioned whether, as the only Latino candidate in the race, he is pigeonholing himself by doing so.

Castro's breakout moment came days after the news outlet Politico ran an article, “Julián Castro can’t catch a break,” lamenting that, even though he is often the first to release detailed policy proposals, it hasn't helped him in the polls.

Even among Latinos, who face the prospect of seeing the first Hispanic in the White House, Castro has not been the favorite or best known of the Democratic candidates, although in polls of Latinos he’s scored among the top or at the top.

On Wednesday night, however, he did draw attention, according to some debate viewers.

"I was quite proud of Julián Castro," Priscilla Orta, an attorney in Brownsville, Texas, said. "He did well and I wasn't expecting that. To see someone I understood, a second-gen Latino. ... This isn't a game, this is about our families."

Can he stay in the spotlight?

Romo, who like Castro is Mexican-American and was also born and raised in San Antonio, said he is a supporter of former Vice President Joe Biden. But Romo said he was excited to see a fellow son of the city and a Latino do so well.

For Castro to build on this newfound attention, Romo said the candidate needs to show Americans "as much as he can" that he has a keen grasp of all issues and continue to show the command and passion he did when discussing immigration during the debate.

“If he shows that and keeps asking other Democrats to join him, people will say he is the type of person to fight, not just for the nomination, but for the presidency against the current incumbent.”

Castro also has been able to show he can win some points with quips. He often starts online videos with “Hey, y’all,” which his campaign, like others, have used as an inclusive LGBTQ campaign message: “Y’all means all."

Onstage, Castro wrapped up his time with the fewest words in Spanish of the candidates who spoke Spanish and is still getting clips on TV with the remark, “And on Jan. 20, 2021, we’ll say adiós to Donald Trump.” That, too, is on a T-shirt the campaign is selling.

Heading into the debate, Castro still lacked the 130,000 unique contributions he needs to qualify for the second round of debates, planned for July in Detroit.

He has a small staff and has not matched higher-polling candidates in hiring staff in key primary states.

At a post-debate event in Miami on Thursday morning organized by the Latino Victory Fund — a political action committee that invests in Latino candidates running for elected office — interim President Melissa Mark-Viverito called Castro's performance his "breakout moment."

But Eduardo Gamarra, a political science professor at Florida International University, said that while Castro's performance was good for him and his campaign, "I don't know that it will be enough."

Shortly after the debate, Castro went on Facebook — where he has been a top spender among the 20-something Democratic candidates — to appeal for contributions, which he said had been surging.

“You saw that I fought every moment for progressive values that we care about,” Castro said.

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.