WASHINGTON — Katie Gorka, wife of former White House adviser Sebastian Gorka, will become a spokeswoman for Customs and Border Protection, according to a Department of Homeland Security spokesperson. Gorka was passed over at the agency for a job overseeing a newly branded office of terror prevention, according to current and former DHS officials.

A DHS spokesperson told NBC News: "Katie has been a valuable member of the DHS team, helping to advance the Department's mission of preventing targeted violence and countering terrorism, regardless of ideology. We look forward to her continued service with the Department in her new position at CBP as we work to secure the border and enforce our nation's immigration laws."

Gorka was on the Trump transition team and then served as an adviser to DHS. CNN was first to report Gorka's appointment to the new position.

Multiple current and former DHS officials told NBC News that Gorka was considered the front-runner to lead the re-branded Office for Targeted Violence and Terrorism Prevention that was created in April but those same officials say she was informed in late May that she would not be named to run the office. David Gersten is serving as the acting director. Gorka left the agency in May after she was passed over.

Asked about the terrorism job, a DHS official said the agency does not comment on personnel decisions.

Katie Gorka, who previously co-authored papers on the threat of Islamic extremism with her husband, was passed over for the job in large part because of concerns that her previous work would be seen as controversial, according to the current and former DHS officials. Gorka has raised alarms about left-wing groups in the United States, while staying silent on the threat from white supremacist and sovereign citizen groups, which experts say are growing.

Her husband, Sebastian Gorka, whose views on Islam and counterterrorism are also considered controversial, served as an adviser in the Trump White House from January to August 2017. He left his job soon after adviser Steve Bannon departed the administration.

Officials within the agency were concerned Katie Gorka's stance would distract from the new office's mission to prevent both foreign and domestic terror threats, said the officials, which may indicate that the Department of Homeland Security is getting more serious about addressing domestic threats.

In previous speeches, including one from December 2015, Gorka criticized the Obama administration and cast doubt on surveys that showed law enforcement officers were concerned about right wing extremism. "The narrative has been put out that the real threat is from right-wing extremism, and so then if you look at surveys of law enforcement and if you had asked them a year ago," they would say their biggest concern was right-wing extremism, she said, "because in a sense that's what they had been told."

Two former DHS officials who spoke to NBC News said Gorka would stay silent in meetings about domestic terrorism from right-wing extremists. One suggested she had a lack of interest; the other said she was listening and receptive to learning.

"Katie came in with some notions, but has been willing to listen and learn," said the second former official, who worked with Gorka on terrorism prevention.

Gorka most recently worked in the DHS Office of Policy, where her work overlapped with the terrorism prevention office. There she was criticized in media reports and by former officials for not paying as much attention to domestic threats from far-right groups as from Islamic militants.

The Huffington Post reported in 2017 that Gorka was behind the decision to revoke a grant given under the Obama administration to Life After Hate, a nonprofit that helps reform former members of hate groups. In emails obtained by the Huffington Post, Gorka raised concerns about the group, pointing to a profanity-laced tweet attacking the president from the former executive director.

In her new role, Gorka will handle the communications for CBP, the nation's largest law enforcement agency, as it struggles to handle the influx of undocumented immigrants crossing the border. CBP has also been criticized for policies implemented under the Trump administration, such as the separation of migrant children from their parents in the summer of 2018 and the deaths of three children in their custody since December.