Five people were dead and 21 injured Saturday after a motorist opened fire in random shootings around Odessa, Texas, police said.

Three of the injured were law enforcement officers — a state trooper, an Odessa police officer and a Midland police officer, Chief Michael Gerke said at a news conference.

"What a horrific day for Odessa," he said.

A senior law enforcement official briefed on the case and a spokesperson for the Texas Department of Public Safety said the shooter had a rifle that may have been a .223 AR-15 style weapon.

Officials were also trying to determine whether the suspect had other weapons on him during the shooting or at his home.

Download the NBC News app for breaking news and politics

Gerke said the attack happened after the suspect, in a gold Honda, was the subject of a 3:17 p.m. traffic stop between Midland and Odessa. The trooper who stopped the suspect was shot, he said.

As the suspect continued firing, one victim was shot at east Loop 338 and Interstate 20, Odessa police said in a statement late Saturday.

The shooter continued west to Odessa, where he shot multiple people, the chief said.

"The suspect continued shooting at innocent civilians all over Odessa," police said in the statement.

The suspect then ditched the vehicle he was using and took a U.S. Postal vehicle to a local movie theater, Cinergy, where a shootout with law enforcement from multiple agencies took place, he said.

"It has been confirmed that the active shooter was shot and killed at the Cinergy in Odessa," Odessa police said on Facebook. "There is no active shooter at this time."

Among the victims is a 17-month-old girl, apparently shot in the face, said Eric Finley, marketing director of Texas' UMC Health System. He said she was in satisfactory condition at a hospital in Lubbock.

The Texas Department of Public Safety said in a statement that the state trooper and two officers were stabilized.

President Donald Trump was briefed on the attacks and had been monitoring the situation, White House communications officials said.

Gov. Greg Abbott called it a "senseless and cowardly attack."

The attack, the second mass shooting in Texas this month, prompted a round of calls for stricter gun laws from some hopefuls running for the Democratic nomination for president.

U.S. Sen. Kamala Harris, D-Calif., said on Twitter, "America is sick of this. We need to act."

Former Congressman Beto O'Rourke of El Paso, Texas, where 22 people were killed in an Aug. 3 attack at a Walmart, tweeted, "More information is forthcoming, but here's what we know: We need to end this epidemic."

U.S. Sen Elizabeth Warren, D-Mass., said on Twitter that the violence makes her "heartsick." "We've already lost far too many to gun violence-Congress must act now," she said.

Mayor Pete Buttigieg of South Bend, Indiana, also called for stricter firearms rules.

Enough. Texas, my heart is with you. America, we must act. — Pete Buttigieg (@PeteButtigieg) August 31, 2019

Entrepreneur Andrew Yang tweeted, "We are better than this. We will do better for our kids."

And California billionaire Tom Steyer called for "emergency gun legislation."

The chorus came as Texas, with the National Rifle Association cheering it on, has loosened up its own gun control laws, with some of the laxer regulations taking effect Sunday.

The new laws will allow licensed handguns in houses of worship, and they'll let gun owners transport and store their weapons in parked vehicles on school grounds.

A car with a bullet hole in a window after a shooter allegedly opened fire on a highway between Odessa and Midland, Texas on Aug. 31, 2019. Ernst Villanueva / via AFP - Getty Images

After initial reports of an active shooting in Odessa, police urged the public to get off the road "and use extreme caution."

Midland police initially said on social media that they believed there were two shooters in two different vehicles. "The two vehicles in question are: gold/white small Toyota truck and a USPS Postal Van."