Former Housing and Urban Development Secretary Julian Castro told Fox News on Thursday night White House adviser Kellyanne Conway should be fired for violating the Hatch Act -- the same federal law that Castro himself was found to have violated in 2016.

The 2020 White House contender's remarks came in a Fox News Town Hall in Tempe, Ariz., hosted by Bret Baier and Martha MacCallum. Separately, the Democrat tried to defend the Hillary Clinton campaign's decision to fund an opposition research dossier written by a British ex-spy, even as he condemned President Trump for saying this week that he would be open to opposition research from foreign actors.

Castro, who served in the Obama administration, qualified on Thursday to participate in the Democrats' first presidential primary debate, along with more than a dozen other candidates.

But, the day also brought an unwelcome spotlight on Castro's past. The Office of Special Counsel (OSC) recommended Thursday that Conway violated the Hatch Act on "numerous occasions," and concluded that she should be removed from federal service.

FOX NEWS EXCLUSIVE: WATCHDOG DEFENDS DECISION TO CALL FOR CONWAY'S TERMINATION

The Hatch Act is a federal law that limits the political activities of certain federal employees. In 2016, "OSC concluded that Secretary Castro violated the Hatch Act by advocating for and against Presidential candidates," the watchdog wrote in a letter to Obama. "Secretary Castro’s statements during [a televised] interview impermissibly mixed his personal political views with official agency business despite his efforts to clarify that some answers were being given in his personal capacity."

Castro was responding to a question from Katie Couric in an interview that focused on HUD policy before pivoting to the then-upcoming 2016 presidential race.

"Now, taking off my HUD hat for a second and just speaking individually, it is very clear that Hillary Clinton is the most experienced, thoughtful, and prepared candidate for president that we have this year," Castro told Couric.

The Obama White House took no action, and OSC did not recommend Castro's termination. Castro, pressed by Baier, argued that his case was different from Conway's, primarily because his violation was an isolated episode and he tried to learn from it.

"Instead of saying, 'Look, I'm going to take these efforts to make sure that doesn't happen again,'" Castro said, "she said, 'To hell with that, I'm going to keep doing it. They said she had repeatedly done that. That's the difference."

Castro added that Conway's apparent lack of remorse was disqualifying: "I don't think we're gonna find anybody either in this race, or in our homes or in our community, that's never made mistakes. The true test of a leader is, what do you do when you make that mistake? Are you big enough to own up to it and then make sure you correct what you do in the future, or do you do, basically, what she did, and say, 'No, I'm bigger than that?'

"No, she did the wrong thing," Castro concluded. "And I support the Office of Special Counsel's determination that because she repeatedly violated it, even though she was told it was a violation, she should be removed from office."

Baier and MacCallum also pushed for Castro to explain his condemnation of Trump's recent statement that he would accept foreign political opposition research if offered. In 2017, Brian Fallon, a former Clinton campaign spokesperson, told The Washington Post that foreign-generated opposition research was a normal part of the political process.

"The first I learned of Christopher Steele or saw any dossier was after the election," Fallon said. "But if I had gotten handed it last fall, I would have had no problem passing it along and urging reporters to look into it. Opposition research happens on every campaign, and here you had probably the most shadowy guy ever running for president, and the FBI certainly has seen fit to look into it. I probably would have volunteered to go to Europe myself to try and verify if it would have helped get more of this out there before the election."

Republicans have pushed for answers on the Hillary Clinton campaign and DNC's role in the creation of the infamous Steele dossier, written by British ex-spy Christopher Steele. The Clinton campaign and DNC, through the opposition research firm Fusion GPS, funded the dossier's creation by the foreign national.

DEMS HAMMER TRUMP FOR STATEMENTS ON FOREIGN OPPO RESEARCH, STAY SILENT ON STEELE DOSSIER, UKRAINE COLLUSION

A key source for Steele was an ex-Russian intelligence officer, according to notes obtained by The Hill and written by Justice Department official Bruce Ohr. "Much of the collection about the Trump campaign ties to Russia comes from a former Russian intelligence officer (? not entirely clear) who lives in the U.S.," Ohr wrote.

The FBI went on to cite the dossier to obtain a secret surveillance warrant to monitor former Trump aide Carter Page. Numerous problems with the Steele dossier's reliability have surfaced, including several issues that were brought to the FBI's attention before it cited the dossier in its FISA application and subsequent renewals.

"Democrats and even some Republicans are criticizing the president for saying he would listen to opposition research from a foreign government if it was offered," MacCallum said, "but one of the questions from the other side that comes up, is how is that really different from the Democrats funding the Steele dossier in 2016 through a British operative that they knew had Russian sources?"

Castro deflected: "Well, first of all, I don't think we should distract our situation from the fact that we have an unprecedented situation here, of a president of the United States, who if I remember the video correctly, was actually sitting in the Oval Office behind his desk saying that he would take intelligence against his political opponent from a foreign government."

SLIDESHOW: JULIAN CASTRO AT FOX NEWS TOWN HALL

Asked about Fallon's remarks concerning the Clinton team's funding of the Steele dossier, Castro asserted that the situations were simply "completely different," without explaining.

"I think it's safe to say we have never seen that moment in American history, and I don't think that's a good thing," Castro said, referring to Trump's comments. "I don't understand why, on this network and in many conservative circles, people are still talking about Hillary Clinton."

Toward the end of the town hall, even as he expressed his opposition to the Hyde Amendment that bans federal funding for abortion, Castro pointedly refused to condemn Biden's recent flip-flop on the issue.

"We're not on the debate stage," Castro, considered a potential vice presidential pick, responded. "The fact is, I need to introduce myself to a lot of people who don't know who I am yet."

CLICK HERE TO GET THE FOX NEWS APP

Immigration also featured prominently early in the town hall, with Castro saying the issue was "personal" to him -- and that Obama, his former boss, had demonstrated real "compassion on the issue."

"I think the crisis that exists is driven by conditions in countries like Honduras, El Salvador and Guatemala," Castro said. "I believe we have a crisis of leadership."

Fox News' Bret Baier and Martha MacCallum contributed to this report.