Crederick Joseph, 37, of Opelousas, La., was shot dead just after midnight at the Merit Inn and Suites in Beaumont, located 90 miles east of Houston.
Officers were dispatched to the motel after receiving reports of a trespasser, according to a Beaumont Police Department statement.
While en route, officers were told the suspect assaulted a clerk and was attempting to rob the motel.
The first officer to arrive took Joseph into custody. However, he was able to grab the officer's baton while he was being handcuffed and began to hit him with it, authorities told KBMT-TV.
The officer, who suffered deep cuts to his face, shot Joseph, Beaumont Police Chief Jimmy Singletary said. The suspect was pronounced dead at the scene. It's not clear how many shots were fired or where Joseph was hit.
The clerk suffered minor injuries. The officer, who has been with the department for 17 months, was placed on administrative while the shooting is being investigated.
Local media outlets reported that Joseph had a long criminal history, including evading arrest.