News of the connection between 15-year-old Natalie "Samantha" Rupnow and the Carlsbad, California man surfaced while authorities worked to determine why she staged Monday's attack at the Abundant Life Christian School in Madison.
In addition to the two fatalities, the suspect wounded six other people before turning the gun on herself.
In Wisconsin, the Dane County Medical Examiner's office identified the two people killed at the school as student Rubi Vergara, 14, and teacher Erin West, 42.
Both were pronounced dead at the scene.
Authorities say two students who were shot at a Wisconsin school are in critical condition. (AP PHOTO)
It remained unclear how the California man and Rupnow were connected but police have been scouring her online activity, checking her mobile phone records and interviewing friends and family to understand her motivations and relationships with others, according to the Associated Press and other media.
Reuters was unable to immediately obtain the full file of the "gun violence emergency protective order" issued under California's red flag law, designed to keep firearms out of the hands of anyone deemed a threat to themselvs or others.
The order was issued on Wednesday, according to a CBS affiliate in San Diego and other outlets.
Reuters was unable immediately to contact the subject, Alexander Charles Paffendorf of Carlsbad.
"During an FBI interview, Paffendorf admitted to the FBI agents that he had told Rupnow that he would arm himself with explosives and a gun and that he would target a government building," reads the two-page restraining order from the Carlsbad Police Department, CBS reported.
The order said FBI agents "saw the messages from Paffendorf to Rupnow".
The order does not say what building Paffendorf had allegedly targeted or when the alleged attack would happen.
It also offered no details about his interactions with Rupnow except to state that the man was plotting a mass shooting with her.
The civil order requires the subject to turn in any guns and ammunition to police within 48 hours, unless police ask for them sooner.
Madison Police Chief Shon Barnes said on Wednesday that Rupnow had two guns with her but apparently only used one of them.
Two of the students shot were in critical condition on Wednesday but police say they will not continue to update their conditions to the media.
A funeral for Vergara has been announced for Saturday in Madison, and there was not an immediate public announcement for West.
Vergara, a 9th grader, the daughter of Vicente and Jennifer (Remus) Vergara, was an avid reader, loved art, singing and playing keyboard in the family worship band, her obituary said.
She also had a special bond with her cat Ginger and dog Coco.
West was a substitute teacher for three years at the school before becoming an in-house substitute teacher and co-ordinator, according to a school statement cited by NBC News.
"She brought her love of Jesus and love of people to our staff and school family all wrapped in a hug and topped with a smile," the school's statement said.