Representative Duncan Hunter, the California Republican whose re-election campaign has been imperiled by a federal indictment, has released a startling attack against his Democratic challenger, suggesting that he is an Islamic terrorist sympathizer and national security risk.

“Ammar Campa-Najjar is working to infiltrate Congress,” says the narrator of Mr. Hunter’s ad, released on YouTube, in reference to the Democrat running against him. “He’s used three different names to hide his family’s ties to terrorism.”

Mr. Campa-Najjar, who until Mr. Hunter’s troubles was considered a very long shot to win a predominantly Republican district in the San Diego suburbs, has a Mexican-American mother and a father who immigrated from the Middle East. His paternal grandfather, Muhammad Youssef al-Najjar, was involved with the plan to murder Israeli athletes at the Olympic Games in Germany in 1972; he was assassinated by Israeli military commandos in 1973.