But citing that case and others in 2017, the lawmakers asked acting defense secretary Patrick Shanahan and Homeland Security Secretary Kirstjen Nielsen, whose agency oversees the Coast Guard, how Hasson and others who demonstrated extremist views were able to circumvent the military’s checks.

“Our hope is that these incidents are isolated events and are not indicative of a larger, systemic issue within the United States Armed Services,” the Democratic lawmakers wrote. “Beyond the extremes of domestic terrorism, we are additionally concerned with low level racism and other identity-based harassment that disrupts unit cohesion, impacts readiness, and degrades the ability of our servicemembers to protect our nation. Servicemembers who experience or witness racist or hateful behavior must be able to report such behavior without fear of repercussions.”

Hasson, 49, was arrested Feb. 15 in Silver Spring, Md., after an investigation that began last fall, when a computer program the Coast Guard uses to search for insider threats identified suspicious behavior allegedly tied to him. He was charged with possession of firearms and ammunition by an unlawful user of a controlled substance and unlawful possession of tramadol, an opioid painkiller.

On Thursday, a judge ordered that Hasson be held for 14 days while federal authorities consider bringing additional charges. Hasson’s attorney, Julie Stelzig, has argued that there was no indication he planned to carry out any violence and that it is not a crime to have negative thoughts.

Hasson had previously served in the Marine Corps and Army National Guard in the late 1980s and 1990s. In a letter to a neo-Nazi quoted in his court filing, authorities said, he wrote that he was a “long time White Nationalist” and had “been a skinhead 30 plus years ago before my time in the military."

A Coast Guard spokesman, Lt. Cmdr. Scott McBride, said Monday that Hasson’s secret security clearance was suspended Feb. 19, the day that news of his arrest became public.

“The Coast Guard takes active measures to prevent, detect, respond and mitigate insider threats,” he said.

A spokesman for the Department of Homeland Security, Tyler Q. Houlton, said that Nielsen has “always denounced violent extremism in all of its forms and is committed to preventing individuals who espouse such views from joining the DHS workforce.”

“We are thankful our Coast Guard Investigative Service, along with our partners at the FBI, were able to root out this threat,” Houlton said. "Hate and bigotry have no place at DHS or in our country.”

In their letter Monday, the lawmakers also noted that service members participated in the “Unite the Right” rally in August 2017 in Charlottesville, in which white nationalists, neo-Nazis, members of the Ku Klux Klan and other extremists gathered. Several were later identified as U.S. service members. In one case, a Marine — Lance Cpl. Vasillios G. Pistolis — was court-martialed and separated from the military.

The lawmakers cited another incident, in May 2017, in which two Marines — Sgt. Michael Chesny and Staff Sgt. Joseph Manning — were charged with trespassing during a pro-Confederate demonstration in Graham, N.C. They unfurled a banner emblazoned with symbols associated with white nationalism, including “YWNRU,” which stands for “You will not replace us,” a slogan chanted in Charlottesville.

“While the vast majority of our service members continue to serve honorably, with distinction, and in adherence to this standard, it appears that some service members are still able to actively associate with extremist organizations,” the lawmakers said.

U.S. military officials have said they study tattoos and conduct criminal background checks to screen for potential ties to extremism. But if nothing troubling is detected during that process or in interviews, it can be difficult to determine whether recruits hold extremist views.

Senior U.S. military officials have condemned open displays of hate, especially after the incident in Charlottesville.