Two police officers in southern California were shot and killed while responding to a possible stabbing at a local motel where they were ambushed by the suspect who was fatally wounded himself during the shootout, authorities said.

El Monte Police Department officers responded to a domestic violence call on Tuesday at the Siesta Inn where they confronted the suspect, who shot one officer inside a room before fleeing to the parking area where he shot another officer, authorities said during a news conference hours after the incident.

The two officers were rushed to the LAC-USC Medical Center where they were pronounced dead.

"The only way to take the sting out of death is to take the love out of life and, believe me, they were loved," Interim El Monte Police Chief Ben Lowry said during a news conference on Tuesday. "They paid the ultimate sacrifice serving their community."

The suspect, an unidentified man who was also struck by gunfire, died at the scene, authorities said. Police found a woman, believed to be the suspect's girlfriend, at the scene. She was not stabbed, they said.

Gun violence in the United States has been under scrutiny after last month's massacres at an elementary school in Uvalde, Texas - which left 19 children and two teachers dead - and a supermarket in Buffalo, New York, which killed 10 people.

The mass shootings in Uvalde and Buffalo have prompted new efforts in the U.S. Congress to enact stricter federal gun control laws.

The names of the officers were not released. The officers were a 22-year veteran, while the other had been a member of the police force for less than a year, Lowry said. Both officers had family ties in the community of 110,000, east of Los Angeles.

"They were acting as the first line of defense for our community members when they were essentially ambushed while trying to keep a family safe," El Monte Mayor Jessica Ancona said.