According to KTVU-TV, the Santa Clara County District Attorney's Office said Maria Garate had been charged with assault with a deadly weapon with a hate crime allegation and attempted murder with a hate crime allegation.
The 18-year-old woman suspect entered the store shortly before 11 a.m. Wednesday, approached a man with his 4-year-old daughter and struck the girl on the head with a crowbar, according to Sgt. Heather Randol.
The woman tried to hit the girl again but the father was able to stop her, Randol said. He was also struck by the crowbar in the attack.
Wal-Mart security detained the woman and held her until police arrived. An employee told TV station KPIX 5 that while Garate was subdued, she yelled out that the girl "deserved it."
Police arrested Maria Garate, an 18-year-old transient from the San Jose area, on suspicion of assault with a deadly weapon, Randol said.
The girl was taken to a hospital with injuries that were not thought to be life threatening.
According to the San Jose Mercury-News, the Wal-Mart where the incident took place is close to a homeless encampment known as "the Jungle." The Mercury-News reported police said they had contacted Garate there before, but could not confirm Garate was a resident of the encampment.
—The Associated Press contributed