Seven people were killed and 22 others injured in a gun rampage in the cities of Midland and Odessa in west Texas as police identified the shooter but remained unsure about his motive.

The gunman, identified as 36-year-old Seth Ator of Odessa, who was shot dead by police after he led them on a high-speed chase, had been fired from his job as a trucker hours before.

Ator began his shooting spree when local Texas Department of Public Safety officials tried to pull him over for driving erratically on the motorway connecting Midland and nearby Odessa.

The rampage continued down a 15-mile stretch of the motorway as Ator fired indiscriminately with an AR-15-style assault rifle from his vehicle. At one point, he hijacked a US Postal Service van.

Ator exchanged gunfire with police officers at the Cinergy cinema complex in Odessa, where he was killed. On Sunday, officials speculated he might have planned to shoot inside the cinema.