A federal judge, a political aide and a nine-year-old girl are among six dead in deadly mass shooting that has left U.S. Representative Gabrielle Giffords "battling for her life."

Giffords, a 40-year-old Democrat, was shot point blank in the head during a public event at a Tucson, Arizona grocery store. Police say a man ran into the crowd and when he reached Giffords, he shot her with a semi-automatic pistol and began firing indiscriminately. He shot 19 people before he was tackled by two people in the crowd.

Police say they have reason to believe a second person was involved in the attack.

Among the dead are U.S. District Judge John Roll, Gabe Zimmerman, the director of community outreach in the congresswoman's Tuscon office, and a nine-year-old girl.

Roll was involved in immigration cases and had previously received death threats. However, police say Giffords was the target.

Dr. Peter Rhee, medical director of the University Medical Center's trauma and critical care unit, said Giffords was shot once, directly through the brain and is in critical condition following surgery.

Dr. Rhee said in a press conference that he was as "optimistic" as possible given the injury. He added that Giffords was responding to commands from doctors.

"I can tell you at this time, I am very optimistic about her recovery," Dr. Rhee said in a news conference. "We cannot tell what kind of recovery but I'm as optimistic as it can get in this kind of situation."

President Barack Obama said Giffords is "battling for her life" in a nationally-televised address.

"This is more than a tragedy for those involved, it is a tragedy for Arizona and a tragedy for our entire country," he said in a news conference. "It's not surprising that today Gabby was doing what she always does, listening to the hopes and concerns of her neighbours. That is the essence of what our democracy is about."

The FBI and local law enforcement are investigating the attack. U.S. The suspect has been identified as Jared Lee Loughner.

He is described as white and 22-years-old. A YouTube channel in Loughner's name features anti-federal government rantings in text against a dark background. He also wrote of inventing a new U.S. currency.

"I know who's listening: Government Officials, and the People," Loughner wrote. "Nearly all the people, who don't know this accurate information of a new currency, aren't aware of mind control and brainwash methods. If I have my civil rights, then this message wouldn't have happen (sic)."

The sheriff's department said their suspect has a "troubled past."

In an impassioned plea, Pima County Sheriff Clarence W. Dupnik said the United States has some "soul-searching to do," saying inflamed political rhetoric on the radio and television has gone too far and was dangerous.

"It's the vitriolic rhetoric that we hear day in and day out from the people in the radio business and some people in the TV business . . . this is not the nice United States of American that most of us grew up in, it's time we do the soul searching," Dupnik said.

Shots didn't stop

Jason Pekau, an employee at a nearby store, heard 15 to 20 shots ring out.

"It was continuous shooting: there was no break," he told CNN. "It sounded like tons of pots and pans falling down around my ears it was so loud."

Pekau said he saw the congresswoman being rushed into a medical helicopter to be flown to hospital and she appeared to be moving slightly.

He said there was no security or police obviously present at the time of the shooting.

Giffords' husband is astronaut Mark Kelly. Kelly was in Houston at the time of the shooting and took a plane Saturday to be by her side.

Gifford was first voted into Congress in 2006. In November, she defeated a tea party favourite. Giffords, a moderate Democrat, had drawn ire for her support of the health care bill.

House Speaker John Boehner echoed Obama's message.

"I am horrified by the senseless attack on Congresswoman Gabrielle Giffords and members of her staff," Boehner said. "An attack on one who serves is an attack on all who serve. Acts and threats of violence against public officials have no place in our society. Our prayers are with Congresswoman Giffords, her staff, all who were injured, and their families. This is a sad day for our country."

Giffords was among 20 Democrats targeted in gun crosshairs in an ad on Sarah Palin's website. Palin has since taken the ad off her website.

In a statement Saturday, Palin said: "My sincere condolences are offered to the family of Rep. Gabrielle Giffords and the other victims of today's tragic shooting in Arizona."