Scott Olson/Getty Images

(CARISBAD, Calif.) -- A judge granted a gun violence protective order against a Carlsbad, California, man who authorities allege was communicating with the Abundant Life Christian School shooting suspect.

Carlsbad police filed the application for a gun violence emergency protective order against Alexander Charles Paffendorf in San Diego County Superior Court on Tuesday. FBI agents "stopped and detained" him after they allege "he was discovered plotting a mass shooting" with Natalie "Samantha" Rupnow, the suspected school shooter in Madison, Wisconsin, according to court records obtained by ABC News.

Paffendorf allegedly admitted to authorities "that he told Rupnow that he would arm himself with explosives and a gun and that he would target a government building," a Carlsbad police officer wrote on the protective order application form.

FBI agents saw messages from Paffendorf to Rupnow, the officer stated. Paffendorf has not been charged with a crime.

Rupnow, 15, allegedly opened fire with a handgun at Abundant Life Christian School on Monday morning, killing a fellow student and teacher. Six others were injured.

She died from a self-inflicted gunshot wound, authorities said.

Police are still investigating a motive for the shooting.

The restraining order requires Paffendorf to surrender all guns, ammunition and magazines to law enforcement or "sell them to or store them with a licensed firearms dealer" within 48 hours of receipt of the order.

The Carlsbad Police Department said in a statement Thursday, "Carlsbad is not the lead agency on this investigation, but we are in communication with our federal partners, and we do not believe there to be a threat to our city. Because this is an ongoing investigation being handled by another agency, there are no other details to share at the moment."

The FBI said Thursday it is "not aware of any ongoing threats associated with this matter in Wisconsin or California."

The agency added, "The Madison Police Department is leading the ongoing investigation into the school shooting in Wisconsin with the assistance of the Milwaukee and San Diego field offices of the FBI, the Carlsbad, California Police Department, and other law enforcement partners. As this is an ongoing investigation, we do not have any further comment."

A hearing for Paffendorf is scheduled for Jan. 3. Attorney information for the California man was not immediately available.

Copyright © 2024, ABC Audio. All rights reserved.