An initial portrait of the man accused of shooting congresswoman Gabrielle Giffords and killing six others began to emerge today.

Authorities in Arizona described a young man with a troubled past and neighbours recalled a loner who often kept to himself.

One former classmate said the accused gunman, Jared Loughner, 22, often did his own thing. Another described him as a student who disrupted class with occasional outbursts.

Neighbours said Loughner was not hostile but did not warm up to anyone either.

"He was a guy in high school who definitely had his opinions on stuff and didn't seem to care what people thought of him," said Grant Wiens, 22, a former classmate at Pima Community College.

Loughner was in custody today after authorities said he opened fire outside a grocery store as Deomcrat Ms Giffords met with voters in Tuscon. The congresswoman was shot in the head and Arizona's chief federal judge, a nine-year-old girl and four others were killed.

Authorities said the accused gunman targeted the three-term congresswoman, but the exact motivation was not immediately known.

Many questioned whether America's polarised political climate had played a role, even as Loughner's political views remained unclear.

Pima County Sheriff Clarence Dupnik described the gunman as mentally unstable and said he possibly acted with an accomplice.

Investigators were poring over versions of a MySpace page that belonged to Loughner and over a YouTube video published weeks ago under an account "Classitup10" and linked to him.

The MySpace page, which was removed within minutes of the gunman being identified by officials, included a mysterious "Goodbye friends" message published hours before the shooting and exhorted people to "Please don't be mad at me".

On his MySpace page, Loughner spoke of how he liked to read and he also wrote repeatedly about literacy, complaining that the rate was especially low in the congressional district where he lived.

"The majority of people, who reside in District-8 are illiterate hilarious. I don't control your English grammar structure, but you control your English grammar structure," he said.

Mr Wiens said Loughner was also critical about religion and talked about how he liked to smoke pot.

"He wasn't really too keen on religion, it seemed like," he said. "I don't know if floating through life is the right term or whatever, but he was really just into doing his own thing."

Loughner's MySpace profile indicated he attended and graduated from school in north west Tucson and had taken college classes. He did not say if he was employed.

Tamara Crawley, director of the Marana Unified School District in Tucson, said Loughner attended Mountain View High School for three years but withdrew after completing his junior year in 2006.

She did not know why Loughner had withdrawn from Mountain View High and it was not clear if he had transferred to another school in the area.

Lynda Sorenson said she was in a maths class with Loughner last summer at Pima Community College's Northwest campus and told the Arizona Daily Star he was "obviously very disturbed".

"He disrupted class frequently with nonsensical outbursts," she said.

In a December 15 YouTube video, Loughner describes himself as a US military recruit, but the army released a statement indicating Loughner was not accepted.

In October 2007 Loughner was cited in Pima County for possession of drug paraphernalia, which was dismissed after he completed a diversion programme, according to online records.

A year later he faced an unknown "local charge" in Marana near Tucson. That charge was also dismissed following the completion of a diversion programme in March 2009, the Daily Star reported.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.