Conservative commentator and Fox Nation host Tomi Lahren apologized on Twitter for remarks she made after a Democratic presidential candidate called her out.

"Disgusting, anti-immigrant rhetoric from @TomiLahren in the wake of El Paso," tweeted Julián Castro, who is a former Obama cabinet official.

Castro, a Texas native, was referring to comments Lahren made on the topic of gun control on Fox Business Network, implying that armed Americans would have to shoot people coming across the border.

"And all the things the Democrats want to put in place, my goodness, if they want to open our borders, you better be sure that the people in Texas, the people in South Dakota, the people in the middle of this country, we're going to be armed and ready," Lahren said to Fox's Stuart Varney on Friday.

Her remarks came a day after 10 Democratic presidential hopefuls, including Castro, took the stage in round three of the primary debates. They condemned President Donald Trump's immigration policies and vowed to secure stronger gun control legislation.

More:Biden campaign calls Julián Castro's attack a 'cheap shot' as both campaign off Democratic debate feud

"We have to have a means to defend ourselves from—who knows who's coming in, that's the thing, we don't know, and we have to be able to protect ourselves," Lahren said on the show.

Lahren later apologized for "the way it came out" in response to Castro's tweet.

"Not what I meant & I apologize for the way it came out. I simply mean without a secure border we don't know who is coming into our nation & those who do wish to do us harm will exploit it," Lahren said. "I'm NOT advocating for violence against any person, regardless of race or immigration status."

El Paso went through a mass shooting last month when a gunman opened fire in a Walmart store and killed 22 people and wounded 25 others. Another shooting in west Texas also left seven dead and another 25 injured.

The gunman in the El Paso shooting was later revealed to have written an anti-immigrant and anti-Hispanic manifesto.

More:Beto O'Rourke: 'Hell, yes, we’re going to take your AR-15, your AK-47' to keep children safe

Lahren has also had to apologize recently for tweeting about California Sen. Kamala Harris, who is running for president: "did you sleep your way to the top...?"