Loughner appeared to have planned the shooting, according to court documents. In a safe at his parents' home, investigators found an envelope with the words "I planned ahead" and "my assassination" written on it, along with the name "Giffords.'' Loughner's signature is also believed to be on the envelope, the complaint says.

In the same safe, authorities found a 2007 letter to Loughner from Giffords, using congressional stationery to thank him for attending a "Congress on Your Corner" event in Tucson. Saturday's shooting took place at another such event, where Giffords was meeting constituents outside a supermarket.

Loughner allegedly shot Giffords in the head during the event - then fired his handgun repeatedly into the crowd around her. In all, 20 people were struck by bullets. Six of them died, including a federal judge and a 9-year-old girl.

Giffords remains sedated and in critical condition, doctors said. After surgery on the wound - in which a single bullet traversed the left side of her skull - they said Giffords was able to follow simple commands, like holding up two fingers when asked.

"This is about as good as good can get" with a bullet injury to the brain, trauma physician Peter Rhee said.

Loughner will be arraigned Monday in federal court in Phoenix. He has been charged with two counts of murder and three counts of attempted murder.

Authorities said Sunday that he appeared to have acted alone, without ties to anti-government or hate groups. A second "person of interest" seen with him near the shooting scene turned out to be the cabdriver who had dropped him off. Authorities said the man had no connection to the shootings.

The court documents also said U.S. District Judge John M. Roll, who was killed, was not targeted in advance. Roll - who had received death threats because of previous rulings - was in the crowd around Giffords. He had come to the event, authorities said, because he wanted to talk to Giffords about the volume of federal cases in Arizona.

New accounts also emerged Sunday about the past few years of Loughner's life, showing that the slim, dark-haired man had undergone a transformation after high school.

Alex Montanaro, a childhood friend of Loughner's, said in a telephone interview Sunday night that Loughner had met Giffords at a public event at a Tucson mall in 2007. He said Loughner had called him the next day and recounted their conversation.

Loughner, whose videos show an obsession with grammar, asked Giffords "something like, 'Why do words mean what they mean?' " Montanaro said. "And apparently she was just sort of dumbfounded and answered him in Spanish."

"He was just sort of annoyed that he didn't get the answer that he was hoping for," Montanaro said. He said Loughner, whom he saw intermittently, didn't speak about Giffords often after that.

"It was never one of those things that I thought would be a relevant story" later, Montanaro said. He said he last saw Loughner around April, when they had classes in nearby rooms at Tucson's Pima Community College.

Montanaro said that he had been close to Loughner in junior high and early high school, but that Loughner then isolated himself with a new girlfriend. When that relationship ended, he said, Loughner remained cut off socially and seemed more disturbed. Montanaro said Loughner would bring over strange stories for him to read and "you'd be like, 'What are you talking about?' "

In his years at Mountain View High School, friends remembered Loughner as odd but generally amiable. He wore shorts some days, like many of the other students, and dark "goth"-style clothes with chains on others. He had had a bitter streak and showed signs of drug use, they said, but was still enough of a joiner to play in the jazz band.

"He was just a normal kid who doodled and wrote things on his notebooks," said high school classmate Michelle Martinez, 22. She remembered Loughner having a girlfriend at one point. "He was just a little weird. He kept to himself," Martinez said.

If Loughner was living at the edge of the mainstream at Mountain View, afterward he fell off it.

After high school, Loughner showed growing signs of mental instability. By last summer, when he was a student in an elementary algebra class at Pima Community College, he was a terrifying presence for both teachers and students.

A student in the class, Lynda Sorenson, 52, said she was immediately worried about him. She said Loughner sat in class with a crazed-looking grin and she had seen him walking in tight circles, around and around, in the school courtyard. She feared that Loughner might become violent, and she would have to flee - concerns she shared with friends and family in a series of e-mails.

"We do have one student in the class who was disruptive today," Sorenson wrote on June 1. "He scares me a bit . . . Hopefully he will be out of class very soon, and not come back with an automatic weapon."

Ten days later, Sorenson was writing about Loughner again: "Class isn't dull as we have a seriously disturbed student in the class, and they are trying to figure out how to get rid of him before he does something bad."

Sorenson's fears grew more acute four days after that, when her e-mail said that "we have a mentally unstable person in the class that scares the living crap out of me. He is one of those whose picture you see on the news, after he has come into class with an automatic weapon. Everyone interviewed would say, Yeah, he was in my math class and he was really weird.''

"I sit by the door with my purse handy," the e-mail continued. "If you see it on the news one night, know that I got out fast."

The instructor of the class, Benjamin McGahee was no less concerned. "I always felt, you know, somewhat paranoid," he said. "When I turned my back to write on the board, I would always turn back quickly - to see if he had a gun."

McGahee said Loughner disrupted his very first class by yelling, "How can you deny math instead of accepting it?" In later classes, he shouted, listened to his MP3 player and wrote nonsensical answers on his tests. One said "Eat + Sleep + Brush Teeth = Math."

McGahee said he sought repeatedly for college officials to remove Loughner, but they did not.

"They just said, 'Well, he hasn't taken any action to hurt anyone. He hasn't provoked anybody. He hasn't brought any weapons to class,' " McGahee recalled. " 'We'll just wait until he takes that next step.' "

College officials did not respond to questions about McGahee's account on Sunday. After about three weeks of class, McGahee said, there was a final confrontation: Loughner arrived and pointed to a copy of the U.S. Constitution on the wall.

" 'You're violating my First Amendment right of free speech,' " McGahee recalled him saying."That's when I went to go get the dean." A college official came, and Loughner was removed permanently from the class.

He was not suspended from the school for another few weeks, until college officials discovered Sept. 29 that he had posted a video on YouTube calling the college "unconstitutional." After that, Loughner agreed to withdraw.

Loughner posted a series of other videos on YouTube, in which he espoused bizarre and often incoherent arguments about mind control, grammar and government abuses. In another video, which he listed as a "favorite," a hooded figure burns an American flag in the desert, while on the soundtrack a hard-rock singer shrieks, "Let the bodies hit the floor!"

In one of the videos, Loughner referenced applying to join the Army. He was rejected for Army service in 2008, Army officials said. A military official who spoke on condition of anonymity said that Loughner failed because of drugs. It was unclear, however, if he had failed urinalysis testing or if his drug history or related questioning led to his rejection.

On Sunday, Loughner's home on Tucson's North Soledad Avenue was empty of the investigators and police cruisers that had crammed the street a day earlier. There was no sign of life at the Loughner home - set among modest ranch houses and split levels.

Neighbors said their interactions with the family were largely limited to watching Loughner's father restore old cars in his driveway. They said they had little interaction with the family and described Loughner's parents as loners who rarely spoke even to their immediate neighbors.

"You try to say something, they'd just ignore you and turn around and walk back into the house," said Ron Johnson, 60, a retiree who lives directly opposite the Loughners' tan one-story home. "The kid - I never talked to him. He acted just like his parents and ignored you."

Comments that include profanity or personal attacks or other inappropriate comments or material will be removed from the site. Additionally, entries that are unsigned or contain "signatures" by someone other than the actual author will be removed. Finally, we will take steps to block users who violate any of our posting standards, terms of use or privacy policies or any other policies governing this site. Please review the full rules governing commentaries and discussions. You are fully responsible for the content that you post.