An erratic wildfire driven by ferocious and shifting winds curled around the location of a team of Arizona Hotshot firefighters, cutting off their access to a safety zone and creating a death trap that quickly consumed them, two fire officials confirmed Friday based on a map of how the tragedy unfolded compiled by The Associated Press.

The map shows that the 19 highly trained Hotshots were just over a quarter of a mile northwest of the safety zone using chain saws, axes and other gear to build a line between the wildfire and the small town of Yarnell on Sunday. But the fire, which was northeast of the team, suddenly changed directions after the winds shifted nearly 180 degrees and cut off their access to the safety zone, a large ranch property.

The AP confirmed the location of the fire crew, their safety zone and the fire's advance based on interviews with people who knew what happened. After building the map, its accuracy was confirmed by Dan Ware, a spokesman for the crews battling the blaze, and Prescott Fire spokesman Wade Ward.

The circumstances of the firefighters' deaths have been known for days but Friday's confirmation offers the most detailed picture about their location and how close to safety they appeared to be.

Officials said the 20th member of the Prescott-based Granite Mountain Hotshots, who served as a lookout for the Hotshot crew and whose exact location during the fire is unclear, was on a hilltop and warned the team that erratic winds had shifted the fire's direction and they were in danger.

The crew had designated a ranch house and its surrounding cleared area as their safety zone, a spot they should be able to reach if things went bad. But the fire moved too fast for them to reach the ranch house, killing the 19 firefighters; the lookout, 21-year-old Brendan McDonough, was able to make it to safety.

A national team of investigators is working to understand more about the firefighters' deaths, visiting the site where they were killed, interviewing McDonough, and examining radio logs and weather conditions. They are expected to release some findings soon, but it will take much longer for a full report.

The lightning-caused wildfire was 80 percent contained Friday, after destroying more than 100 of the roughly 700 homes in Yarnell and burning about 13 square miles.

Fire bosses have begun sending some crews home, and power and gas companies were working to restore service in Yarnell. Residents remained evacuated Friday, but crews were hoping to let them back either this weekend or early next week.

Sens. John McCain and Jeff Flake were planning to meet with Yarnell residents on Friday and speak to members of the media afterward.

A memorial service for the firefighters is set for Tuesday, with Vice President Joe Biden expected to attend.

Autopsies of the firefighters showed they all died of either burns or inhalation issues, or a combination of both. Their bodies, in Phoenix for autopsies, are set to be returned home to Prescott on Sunday in a 75-mile procession.