A Texas man sleeping in his truck on Tuesday allegedly shot a suspect 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 male suspect "possibly armed with pistols" entered the victim's truck while he was sleeping and "attempted to rob" him, Sheriff Ed Gonzalez said in a post.

"The male sleeping in the truck had an AR-15 and shot the male several times," Gonzalez said.

ILLEGAL MIGRANTS CHARGED WITH MURDER, CHILD SEX CONVICTIONS ARRESTED AT BORDER

331 Paramatta Ln in Houston

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

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

The man who killed the suspect told investigators that 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 GUN

Harris County Sheriff's Office deputies arrive at the scene of the shooting

The Harris County Sheriff's Office is investigating the shooting of an alleged robbery suspect on Tuesday. (FOX 26 Houston)

He awoke to the suspect inside his vehicle attempting to rob him and fired his AR-15. He reportedly ran to his 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 TOW OPENS FIRE INSIDE JOEL OSTEEN'S HOUSTON MEGACHURCH

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," one Facebook user wrote. 

CLICK HERE TO GET THE FOX NEWS APP 

"They had no business trying to rob the guy....they would still be breathing had they made better choices," said another.

Further investigation will allow the sheriff's office to determine whether any charges will be filed in the case.