Texas man sentenced in 3D-printed gun case, had 'hit list' of US lawmakers Eric McGinnis referred to himself as "Eric the Ruler."

Authorities say he referred to himself as “Eric the Ruler” and he wanted to get a gun.

According to court records, in 2016, Eric McGinnis went to a federally-licensed gun dealer in Texas to attempt to buy a firearm, but he was stopped from doing so after a required criminal background check revealed a 2015 protective order against him, stemming from an "act of family violence" against his girlfriend.

By flagging him as a prohibited purchaser, the federal background check system appeared to work as designed. By state and federal law, McGinnis was barred from possessing a firearm.

But the story didn’t end there. In 2016, McGinnis sidestepped the background check by using a 3D printer to build an AR-15 assault rifle.

The debate over 3D-printed guns has heated up in recent years as printing technology has become more available and affordable. The technology allows people to manufacture guns using design templates and instructions that can be found on the internet and can be used with inexpensive 3D printers. Those privately-printed guns are unregulated and untraceable, providing a new way for firearms to end up in the wrong hands.

In 2013, a Texas company called Defense Distributed posted design files for 3D-printed guns on its website, spurring a series of regulatory actions and lawsuits. Last July, a federal judge in Washington issued a temporary restraining order keeping Defense Distributed from posting downloadable files containing designs for 3D-printed firearms. It is unclear whether Defense Distributed's designs were used by McGinnis.

Soon after being prevented from purchasing a firearm, McGinnis set about producing his own weapon. In July 2017, police officers in Grand Prairie, Texas, heard gunshots coming from a wooded area in the city, according to court records. Body camera video obtained by ABC News depicts the encounter police had with McGinnis as he came out of the woods. He told police he had a gun in his backpack.

After taking him into custody, officers searched the backpack and found an AR-15 assault rifle with a short barrel. Rifles with barrels shorter than 16 inches are illegal to possess without being registered with the federal government, under the National Firearms Act of 1934.

His backpack also contained a document, titled “List of American Terrorists,” -- which prosecutors described as a "hit list" -- that included the names and purported addresses of current and former members of Congress. According to prosecutors, an analysis of McGinnis’ electronic devices showed McGinnis had a strong interest in the June 2017 Congressional Baseball shooting incident in Alexandria, Virginia, that left Rep. Steve Scalise and three others wounded. He also falsely told authorities he worked for the CIA.

By September 2017, McGinnis had been indicted on two federal firearms charges. A federal magistrate judge in October 2017 said his “seemingly irrational behavior” was consistent with “reports that [McGinnis] suffers from serious mental health problems, for which he voluntarily ceased treatment, including prescribed medication.”

But the rifle McGinnis built had another distinguishing feature that was unusual: It had no serial number on the part of the gun called the lower receiver, which appeared to be made of plastic.

The lower receiver is the part of rifles like the AR-15 that contains the firing mechanism. Under federal law, that one part, by itself, is considered a firearm and is tightly regulated. A background check is required to buy a finished lower receiver from a licensed dealer.

The other parts of the gun, like the barrel, the stock and other accessories, can be purchased without a background check.

“What this really shows is that there are a number of loopholes, including 3D-printed guns, that exist that still allow these very dangerous people to get guns,” said Kyleanne Hunter of the Brady Campaign and Center to Prevent Gun Violence told ABC News.

McGinnis was determined to get his hands on a gun. He was able to easily obtain the unregulated parts of the AR-15 -- the barrel, the stock, the sight and magazines to hold ammunition. And to make it a functioning AR-15, McGinnis printed the lower receiver himself.

“When he realized he couldn’t legally purchase a firearm, Eric McGinnis circumvented our gun laws by 3D-printing his weapon, eliminating the need for a background check," Erin Nealy Cox, U.S. attorney for the Northern District of Texas, told ABC News in a statement.

After his arrest, McGinnis spoke with a family member in a recorded jailhouse call. He told her, “I didn’t buy a gun, I built the gun. The upper, I printed a lower, and I built it, installed the trigger and did all that stuff. I built it.”

But 3D-printed guns can be dangerous to use and are prone to fail, according to firearms experts. Law enforcement officials say commercially manufactured guns can be easily purchased without going through background checks through private sales on the so-called gray market.

“Because of the gray market, firearms are readily available to those who are prohibited. It doesn’t take much to obtain one,” retired ATF Special Agent in Charge Bernard Zapor told ABC News. “It's interesting to hear of somebody manufacturing a firearm from a 3D printer,” but Zapor added, it is “much easier to obtain one.”

“This case should send a message to prohibited persons contemplating acquiring guns by any method: this office is committed to keeping guns out of the hands of those who violate domestic violence protective orders, no matter how their guns are obtained -- by theft, purchase, or 3D printing,” Nealy Cox said.

McGinnis was convicted in June on both firearms counts and on Wednesday he was sentenced to eight years in prison plus three years of supervised release.