The black Texas woman who was fatally shot by a white cop through the window of her home picked up her gun before she was killed because she heard a noise outside, according to documents released Tuesday.

Atatiana Jefferson, 28, had been up late with her 8-year-old nephew playing video games when she heard movement outside of the house around 2:30 a.m. and grabbed the gun, according to the arrest warrant for Fort Worth Police Officer Dean Aaron, who was charged with Jefferson’s murder Monday night.

Police were called to the home after a neighbor noticed Jefferson’s door was left open and grew concerned. The door was open because it was cool outside and Jefferson was letting some fresh air into the home, her family told WFAA.

Instead of knocking on the door to check on Jefferson, Dean and his partner started searching around the home and examining its perimeter, the warrant states.

When Jefferson heard the noise, she grabbed her gun out of her purse, Jefferson’s nephew told cops.

She then “raised her handgun” and “pointed it toward the window” — only to be shot dead within seconds, the warrant says.

“It makes sense she would have a gun if she felt threatened or if there was someone in the backyard,” Fort Worth Police Chief Ed Kraus told reporters at an afternoon press conference.

Dean’s partner, Officer C.A. Darch, told investigators she could “only see Jefferson’s face through the window” when her partner fired his gun and did not report seeing a weapon, according to the warrant.

Dean resigned from the police department just hours before his arrest Monday, rather than being canned for breaching the department’s policies, Kraus said.

Dean has since been released on bail.

An independent panel of experts will probe the police department after the shooting.

Jefferson’s family lawyer, Lee Merritt, alleged Fort Worth police have fatally shot seven people in less than six months and need to be scrutinized.

With Post wires