Democratic presidential nominee Joe Biden on Sunday called for gun control less than 24 hours after two Los Angeles County sheriff’s deputies who were critically wounded in Compton after a gunman opened fire on their squad car in an apparent ambush.

“Weapons of war have no place in our communities,” the former Vice President tweeted. “We need to ban assault weapons and high-capacity magazines.”

Earlier Biden had called the shooting “unconscionable” and for the suspect to be brought to justice. He also said anyone who commits an act of violence “should be caught and punished.”

Biden’s comments on the ambush and gun control stand in stark contrast to President Donald Trump who called for a “fast trial” with the possibility of the death penalty.

“Animals that must be hit hard!” Trump tweeted, referring to criminals who target law enforcement.

"If [the deputies] die, fast trial death penalty for the killer. Only way to stop this!" Trump later wrote.

The president continued to attack his Democratic rival on Sunday, calling for tougher criminal sentencing guidelines and faster courts.

NEW YORK POLICE OFFICER OUTRAGED OVER LA SHERIFFS BEING AMBUSHED, OFFERS 'FUND THE FIRST' SUPPORT TO FRIENDS AND FAMILY

Speaking at a roundtable campaign event in Las Vegas, Trump used Saturday night’s ambush to highlight his campaign’s “law and order” while casting Biden as weak on crime.

“He’s not strong for law and order and everybody knows that,” Trump said of Biden during at a “Latinos for Trump” event. “When you see a scene like happened just last night in California with the two police people – a woman, a man – shot at stone cold short range.”

CLICK HERE TO GET THE FOX NEWS APP

The 31-year-old female deputy and 24-year-old male deputy underwent surgery Saturday evening and were listed as in “critical” condition. A manhunt for the suspect was still underway on Sunday.

Fox News' Andrew O'Reilly contributed to this report.