TUCSON, Ariz. (AP) - Rep. Gabrielle Giffords of Arizona was shot in the head today when an assailant opened fire outside a grocery store during a meeting with constituents, killing at least five people and wounding several others.

Giffords was among at least 10 people wounded, and the hospital says her outlook is "optimistic" and that she was responding to commands from doctors.

The hospital says a 9-year-old girl was among those killed, and a U.S. Marshal says a federal judge was also fatally shot in the attack.

Giffords spokesman C.J. Karamargin says an unspecified number of her staff members were injured in the shooting.

Congressional officials say an aide to the Democrat was killed, and President Barack Obama says five people died in all.

U.S. Capitol police say the shooter is in custody.

One official says the attack was carried out with an automatic weapon.

Giffords had just begun her third term.

The 40-year-old Democrat was re-elected in November, edging a tea party favorite.

She was a member of the Arizona House and Senate before coming to Washington.

(Copyright 2011 by The Associated Press. All Rights Reserved.)