A man who was barred from possessing firearms was sentenced to eight years in prison on Wednesday after Grand Prairie police found him carrying a weapon with some 3D printed parts and a list of lawmakers’ addresses, federal prosecutors said.

In July 2017, officers responding to another call found Eric Gerard McGinnis, then 39, after hearing someone firing shots in a wooded area outside Dallas, according to a statement from the U.S. attorney’s office in the Northern District of Texas. McGinnis falsely told officers he was a CIA agent and was arrested, the statement said.

Officers searched a backpack McGinnis was carrying and found a partially 3D-printed weapon that was loaded, and a list with office and home addresses of several federal lawmakers, including Democrats and Republicans, the statement said.

Prosecutors said McGinnis had a protective order filed against him after a violent altercation with his live-in girlfriend and he was prohibited him from possessing firearms or ammunition at the time. However, he tried to buy a semi-automatic rifle at a licensed gun shop almost a year before his 2017 arrest, federal prosecutors said. The purchase was rejected after the store ran a background check on McGinnis.

McGinnis then assembled a rifle using several weapon parts and a 3D printer to build the weapon's firing mechanism, the U.S. attorney’s office said. He admitted in a jailhouse conversation with a relative that he built the parts, prosecutors said.

“Mr. McGinnis applied evolving technology to bypass those controls to manufacture an untraceable NFA weapon. The fact a prohibited person was able to manufacture an untraceable firearm with apparent ease and anonymity presents a significant challenge and major concern to law enforcement and our community,” said Jeffrey C. Boshek II, a special agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives.

Before his sentencing, a jury had found McGinnis guilty of possessing an unregistered short-barrel rifle and unlawfully possessing ammunition while subject to an active protective order, prosecutors said.

“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,” said U.S. Attorney for the Northern District of Texas Erin Nealy Cox. “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 protective orders for domestic violence, no matter how the guns are obtained – by theft, purchase, or 3D printing.”