A man walked into a Walmart carrying at least two guns before engaging in a shootout with police outside the store, authorities said. The man was killed and an off-duty officer in the store who had tried to stop him was injured.

The shootout Sunday in the east Texas city of Commerce began when police received a call that shots had been fired from a car in nearby Greenville, about 50 miles northeast of Dallas, said City of Commerce spokeswoman Marty Cunningham.

Commerce police intercepted the car just outside the city limits, where the man exchanged gunfire with officers, Cunningham said. He then drove to Walmart and entered the store "carrying a long gun and pistol," the spokeswoman said.

Cunningham said an off-duty officer from another agency was in the store and saw the man leave. The officer tried to stop the suspect in front of the store, where the officer and Commerce police exchanged gunfire with the man.

The off-duty officer was taken to a hospital with unknown injuries, Cunningham said. She said two people inside the store at the time of the shooting were hospitalized after complaining of chest pains.