ST. PAUL, Minn. (AP) — Investigators say a man fired gunshots into a bedroom wall and pointed a gun at his roommate before he was fatally shot by St. Paul police.

A search warrant filed Tuesday by the Minnesota Bureau of Criminal Apprehension contains details about the moments leading up to the fatal police shooting on Aug. 5.

The document says William "Billy" Hughes became angry and fired two or three gunshots into a wall in his apartment before pointing a gun at his roommate's head. The Star Tribune says the roommate fled and called police.

The warrant says relatives told investigators Hughes had been suicidal over a terminal illness that limited his quality of life.

The bureau has said Hughes was shot after police knocked on one of the apartment's doors and he came out another. The agency continues its investigation.