The gunman who killed two people and himself in a shooting rampage at a U.S. mall during the Christmas shopping season was 22 and used a rifle stolen from someone he knew, authorities said Wednesday.

The rifle jammed, and mall employees had been trained for the possibility of a mass shooting, meaning the death toll might have been worse.

'This could have been much, much worse.'—Sheriff Craig Roberts

Jacob Tyler Roberts had armed himself with an AR-15 semiautomatic rifle and had several fully loaded magazines when he arrived at a Portland, Ore., mall on Tuesday afternoon, said Clackamas County Sheriff Craig Roberts.

The sheriff said the rifle jammed during the attack, but Roberts managed to get it working again. He later shot himself. The sheriff said authorities didn't yet have a motive.

The shooter, who wore a mask, fired randomly, investigators said.

Employees at the mall had been trained to run and hide, lock down and evacuate. Since previous mass shootings elsewhere in the U.S., the first arriving police officers were trained to form teams and go inside instead of waiting for specialty teams.

"This could have been much, much worse," Roberts said.

Two people — a 54-year-old woman and a 45-year-old man — were killed, and another woman, Kristina Shevchenko, whose age could not be confirmed, was wounded and is in serious condition.

A law enforcement official told The Associated Press the shooter did not have a criminal record. The official spoke on condition of anonymity because he was not authorized to discuss details of an ongoing criminal investigation.

'I am the shooter'

The shooting started shortly after a man in a white mask carrying a rifle and wearing a bulletproof vest said, "I am the shooter," as if announcing himself, said Austin Patty, 20, who works at a mall department store.

A series of rapid-fire shots followed as Christmas music continued to play. Patty said he ducked and then ran.

Witnesses said the shooter fired several times near the mall food court before the rifle jammed, and he dropped a magazine onto the floor and ran into the Macy's store.

"I saw a gentleman face down, obviously shot in the head," said Jason DeCosta, the manager of company with a display on the mall's ground floor. "A lot of blood. You could tell there was nothing you could do for him."

DeCosta said he also saw a woman on the floor who had been shot in the chest.

The first emergency call came at 3:29 p.m. PT Tuesday. The first officers arrived a minute later. By 3:51 p.m., all the victims and the gunman and rifle and been found.

Fortune cookie

The mall Santa, Brance Wilson, said he heard gunshots and dove for the floor. By the time he looked up, seconds later, everyone around him had cleared out. Parents with children joined other shoppers rushing to stores' backrooms for safety.

"Santa will be back," Wilson said. "It's not going to keep Santa away from the mall."

Shaun Wik, 20, said he was Christmas shopping with his girlfriend and opened a fortune cookie at the food court. Inside was written: "Live for today. Remember yesterday. Think of tomorrow."

As he read it, he heard three shots. He heard a man he believes was the gunman shout, "Get down!" but Wik and his girlfriend ran. He heard seven or eight more shots. He didn't turn around.

"If I had looked back, I might not be standing here," Wik said.