A Texas man is accused of posing as an Amazon delivery worker in order to take his ex-girlfriend hostage, police said.

>> Read more trending news

Thomas Hill, 31, is accused of using Amazon packages to block his face as a ruse to force his way into his ex-girlfriend's home on Aug. 6, KXAN reported. Hill allegedly held his girlfriend hostage until Aug. 9, when the woman's home security company alerted police.

Hill's former girlfriend told police that the pair ended their relationship about four months ago and that Hill was mentally unstable. The former girlfriend said she had a protective order against Hill.

When Hill barged into the home, he brandished a gun, according to the arrest affidavit. The ex-girlfriend felt it necessary to go along with his commands, because he threatened her and her daughter and physically assaulted her when she didn't obey, KXAN reported. An opportunity to get help arose Aug. 9 when Hill left the home to get groceries. She was able to alert her home security company, who in turn alerted authorities.

Police arrested Hill, who has been charged with aggravated kidnapping, burglary and assault, along with violation of a protective order, according to the Williamson County Jail records.