A woman wielding two knives went on a rampage Monday at a Target store in West Hollywood, stabbing four shoppers in an apparently random attack that left one victim in critical condition, authorities said.

Detectives from the Los Angeles County Sheriff’s Department are still trying to determine a reason for the attack.

Entertainment journalist Allison McNamara was shopping at the store when she encountered a screaming woman in the aisle that separates the skin care and kitchen sections.

“She was yelling ‘I’m bipolar. There’s no witness protection program.’ ”

McNamara said she watched helplessly as the woman plunged a knife into the upper back and shoulder of a male shopper. He had crouched down and covered up to fend off the blows, she said.

“You could see where the knife was going into his back. The knife had ridges and a tag on it. She was going as fast and strong as she could. Four to six inches were covered in blood. She looked like she was going to stab everyone there,” McNamara said.

Moments later, the woman looked straight at McNamara, who immediately bolted out of the store with other shoppers and employees. McNamara immediately sent out a Twitter message telling people what she had seen.

Authorities credited Deputy Clay Grant Jr., who was off duty, with preventing additional casualties. Grant was at the Target shopping for paper towels on his day off when he heard screams.

Customers began racing past him toward the exit. “Somebody has a knife,” he heard someone in the crowd say.

Out of the cosmetics aisle he saw a young woman wearing a halter top and flowery pants, with a steak knife in one hand and a butcher knife in the other.

Grant, 26, drew his Beretta service weapon and identified himself to the woman as a sheriff’s deputy. He demanded she drop the knives. The woman, he said, ran down the aisle, turned and dashed past four other aisles.

“Drop your knife” he ordered again.

She turned, her expression blank and confused, clutching the knives. He said he recalled his training, decided that from her distance of about 20 feet she was no danger to him, and chose not to pull the trigger.

The woman saw his gun and dropped both knives on the floor.

Grant and Target security officials restrained the woman, then handcuffed her.

Hours later, after recounting the incident to his worried mother, Grant said he didn’t feel like a hero.

“I just come here to do my duties,” the soft-spoken deputy said.

Authorities identified the alleged attacker as Layla Rosetta Trawick, 34, of Antioch, Calif.

Trawick entered the store at La Brea Avenue and Santa Monica Boulevard after noon and picked up two knives, apparently merchandise from the store.

The stabbing set off a stampede of customers, authorities said.

Deputies with the sheriff’s West Hollywood station responded after numerous 911 calls reported a gunman at the Target, Sgt. Josh Mankini said. Officials speculate the “gunman” was probably Grant.

“There was a panic in the store,” Mankini said.

Officials praised Grant for his quick thinking, saying he might have prevented the situation from getting far worse.

“We are exceptionally proud of Deputy Grant,” sheriff’s Capt. Michael Parker said. “The reason why this tragic situation wasn’t worse was because of the quick thinking of an armed, off-duty sheriff’s deputy who was willing to risk his life to end this situation.”

Four people were wounded, including a woman who was carrying a baby. The baby was unhurt. The most seriously injured victim was taken to Cedars-Sinai Medical Center in critical condition, officials said. He was showing signs of improvement late Monday.

L.A. County Sheriff’s Department spokesman Steve Whitmore said Trawick is being held at the West Hollywood Sheriff’s Station jail on $1-million bond. Store security cameras captured the attack, but the footage is not being released.

andrew.blankstein@latimes.com

robert.faturechi@latimes.com