COMPTON, Calif. — President Trump and Democratic presidential nominee Joe Biden on Sunday denounced what police called an ambush of two Los Angeles County sheriff's deputies and said the attacker, still at large, should face harsh punishment.

The sheriff expressed optimism Sunday that the deputies would recover after being shot Saturday night as they sat in their patrol vehicle in Compton. A video released by authorities shows a person walk up to a parked police car, fire a gun into the passenger-side window and then run away.

Police and elected officials have urged the community to come together in condemnation of the attack, which comes at a fraught moment for law enforcement across the nation and in Los Angeles. Police agencies, including the sheriff’s department there, have faced mounting anger and demonstrations over deadly force deployed against people of color.

But politicians and community leaders — including prominent critics of law enforcement — quickly denounced Saturday’s violence, as the FBI and Justice Department both offered their resources.

In an early-morning tweet, Trump, who has campaigned on “law and order,” called for a forceful response.

“Animals that must be hit hard!” he said. Later Sunday morning, Trump tweeted of the officers: “If they die, fast trial death penalty for the killer. Only way to stop this!” At a roundtable in Nevada, the president spoke of stiffer penalties for violence, saying that if a suspect is apprehended, “we are going to get much faster with our courts and we have to get much tougher with our sentencing.”

Biden also condemned the “cold-blooded shooting” in a tweet Sunday morning.

“Acts of lawlessness and violence directed against police officers are unacceptable, outrageous, and entirely counterproductive to the pursuit of greater peace and justice in America — as are the actions of those who cheer such attacks on,” Biden said in a statement Sunday afternoon. “Those who perpetrate these crimes must be brought to justice, and, if convicted, face the full brunt of the law.”

And Ben Crump, a prominent lawyer representing families of Black men and women killed by police — including the relatives of a man fatally shot by Los Angeles sheriff’s deputies — urged people to come forward with information about the attack, after reiterating his calls to hold the Los Angeles Sheriff’s Department “accountable for systemic brutality.”

Violence such as the two deputies’ shooting “is NOT the answer,” he tweeted.

The injured deputies, a 31-year-old woman and a 24-year-old man, were both sworn into office 14 months ago, officials said at a news conference. Both suffered multiple gunshot wounds, according to authorities, and underwent surgery Saturday night.

Sheriff Alex Villanueva called the shooting a “cowardly act,” echoing the words of California Assemblyman Reggie Jones-Sawyer (D) earlier at the news conference. Jones-Sawyer called the deputies “heroes,” and Villanueva said the attack was a reminder of the tough and dangerous job facing law enforcement.

“Seeing somebody just walk up and start shooting on them, it’s — it pisses me off,” Villanueva said. “It dismays me at the same time.”

Authorities have not discussed the shooter’s potential motive. The sheriff’s department said Sunday that no updates on the investigation were available.

Last year, 48 law enforcement officers were killed by an offender “while engaged in or on account of the performance of their official duties,” according to the FBI. Villanueva, who on Sunday tweeted appreciation for “overwhelming support” from across the country, expressed concern about other suspects opening fire on officers “unprovoked.”

The deputies, part of a transportation detail, were shot about 7 p.m. Saturday and were able to radio for help, according to the sheriff’s department. The shooter fled on foot. Sheriff’s Capt. Kent Wegener said Saturday night that despite video capturing the incident, authorities have only a “very, very generic suspect description” provided by one of the wounded deputies: Details captured through a “fisheye lens,” he said, are “going to be deceiving.”

Sunday afternoon, the sheriff’s department announced a $100,000 reward for information “leading to the arrest and conviction of the suspect,” who was described as a black man between 28 and 30 years old in dark clothing.

More than a dozen homicide detectives were on the scene Saturday night, along with other specialists and district attorney staff. Calling the shooting “evil in its purest form,” Justice Department spokeswoman Kerri Kupec tweeted that Attorney General William P. Barr is “monitoring the situation” and that his department will “use all federal tools available to assist in bringing anyone responsible to justice.”

Employees at Superior Grocers in Compton, near the location of the shooting, said they knew something was wrong Saturday night when they heard screaming.

Store sales manager Juan Ceja, 33, said he heard people outside shouting “gunshot, gunshots.” He ran out of the big-box store to find scared employees and dozens of people running.

“Why would you come shoot two officers who were just in their squad car?” he wondered, saying it “makes no sense.”

Some of his employees were not as concerned as he was about the police, he said. “One of the guys said back, ‘That’s what they deserve,’ ” Ceja recalled. “And I was like, ‘They were just in a squad car, what did they deserve to get those gunshots?’ ”

Both police and protesters’ tactics drew scrutiny after demonstrations formed Saturday outside St. Francis Medical Center, where the deputies received treatment.

In tweets, the sheriff’s department said protesters were “blocking the entrance & exit” of the hospital’s emergency room. In videos of the event, protesters gather on paths outside the medical center and a person can heard saying, “I hope they die.” The department also announced the arrests of two people: a male protester who “refused to comply” after a dispersal order and a woman “later identified as a member of the press.”

Josie Huang, a reporter for local new organizations KPCC and LAist, said she was detained and cited on a charge of obstructing an officer, despite wearing a lanyard identifying her as press. She posted video of officers telling her to back up as she films an arrest. In another clip, she says she is a reporter. “You guys are hurting me!” she says.

Police officials said Huang was arrested because she interfered with another arrest and “did not identify herself as press.”

Journalists quickly condemned the arrest as a violation of Huang’s rights, calling for the charge to be dropped. The sheriff’s department did not respond to questions about Huang.

Sunday afternoon, the scene outside St. Francis Medical Center was calm. Officers said the protests had ended Saturday. Three members of the sheriff’s department stood outside the hospital’s entrance holding gifts, balloons, a teddy bear and a letter addressed to “Our Hero.”

Sonmez and Knowles reported from Washington.