Six people were injured, one critically, in.
Dominick Sergio Maldonado, 20, surrendered about four hours after he ducked into a music store and took three hostages, all of whom were released unharmed, authorities said.
Maldonado, a high school graduate who has been in trouble with the law before, has his first court appearance Monday afternoon in Pierce County Superior Court, CBS' Jennifer Miller reports.
Tiffany Robison, Maldonado's former girlfriend, said in an interview broadcast Monday on ABC's "Good Morning America" that he sent her a text message shortly before noon reading: "Today is the day that the world will know my anger."
She said he also contacted her during the standoff.
"He called me and said he just shot up the Tacoma Mall and he's in the Sam Goody taking hostages," Robison said.
Bret Strickler, who said he was Maldonado's best friend, told the Seattle Post-Intelligencer he received a similar text message while Maldonado was holding the hostages.
Authorities said they began getting calls about 12:15 p.m. that shots had been fired inside the mall. The first caller said a gunman "was in the mall, walking along, firing," Tacoma police spokesman Mark Fulghum said.
State Patrol and police units from nearby agencies clustered around an entrance at the south end.
Inside, Stacy Wilson, 29, heard a popping noise and turned around.
"I saw the gunman randomly shooting. I ran with a group of women to Victoria's Secret," Wilson said. She said they crouched behind a wall in the store, and when the shooting stopped, an employee ran out and closed a security gate at the front.
Wilson said she heard 15 to 20 shots.
"He was walking backward and shooting. I couldn't see his face," she said. "Everyone was running and screaming."
A man told KING-TV the gunman was smiling as he fired an assault rifle in bursts of four to five shots.
A woman who said she made eye contact with the "very clean-cut" gunman before he opened fire told Northwest Cable News, "When I heard the shooting I thought, 'This is a joke. ... I couldn't believe this was actually happening, that someone would do this."
Court records show Maldonado has an extensive juvenile criminal history dating back to 1998. He has been convicted of burglary, theft and possession of burglary tools and he had been ordered not to possess any weapons.