A Texas man sleeping in his truck Tuesday allegedly shot a suspect who was trying to break into his vehicle, according to Harris County authorities.

The Harris County Sheriff’s Office responded to the scene outside an apartment complex at 331 Parramatta Lane in Houston early Tuesday morning.

A preliminary investigation revealed that a suspect “possibly armed with guns” entered the victim’s truck while he was sleeping and “attempted to rob him,” Sheriff Ed Gonzalez said in a post.

“The man who was sleeping in the truck had an AR-15 and he shot him several times,” Gonzalez said.

ILLEGAL MIGRANTS CHARGED WITH MURDER AND CONVICTIONS FOR CHILD SEX ARRESTED AT THE BORDER

331 Paramatta Ln in Houston

A robbery victim who was sleeping in his truck outside an apartment complex on Parramatta Lane in Houston shot and killed a suspect who broke into his vehicle Tuesday morning, according to Harris County authorities. (Google Maps)

The suspect was pronounced dead at the scene, according to authorities.

The man who killed the suspect told investigators he was sleeping in his truck after an argument with his girlfriend, according to FOX 26 Houston.

LAKEWOOD CHURCH SHOOTER IDENTIFIED AS GENESSE IVONNE MORENO; ‘PALESTINE’ WRITTEN ON A GUN

Harris County, Texas Cruise

A Harris County Sheriff’s Office patrol car sits in a parking lot. (Harris County Sheriff’s Office/Facebook)

He woke up and saw the suspect inside his vehicle attempting to rob him and fired his AR-15. She reportedly ran to her brother’s apartment after the shooting and called 911, FOX 26 reported.

The man remained at the scene and is cooperating with investigators, authorities told the outlet.

WOMAN WITH CHILD IN TRAILER OPENS FIRE INSIDE JOEL OSTEEN MEGACHURCH IN HOUSTON

The sheriff’s office believes the suspect may have broken into other vehicles in the area, FOX 26 reported.

Social media users applauded the man’s actions.

“When someone tries to rob you, you have every right to defend yourself,” wrote one Facebook user.

CLICK HERE TO GET THE FOX NEWS APP

“They had no business trying to rob the guy…they would still be breathing if they had made better decisions,” said another.

Further investigation will allow the sheriff’s office to determine if charges will be filed in the case.

By Sam