Apocalypto

While hunting in the Mesoamerican rainforest, Jaguar Paw (Rudy Youngblood), his father Flint Sky (Morris Birdyellowhead), and their fellow tribesmen encounter a procession of refugees fleeing warfare. The group's leader explains that their lands were ravaged and they seek a new beginning. He asks for permission to pass through the jungle. Flint Sky comments to his son that the visitors were sick with fear, and urges him to never allow fear.
At sunrise the next morning the tribe's village is raided by a group led by Zero Wolf (Raoul Trujillo). Huts are set on fire, many villagers are killed, including Flint Sky, and the rest of the adults are taken captive. Jaguar Paw's heavily pregnant wife Seven (Dalia HernÃ¡ndez) and their young son Turtles Run (Carlos Emilio BÃ¡ez) escape by hiding in a small natural pit cave that also serves as a water reservoir, but are left trapped when Jaguar Paw is captured. The raiders then lead the captives on a long forced march through the jungle, having left the children behind to fend for themselves.
On the journey Cocoa Leaf (Israel RÃ­os), a badly wounded captive, is killed by the sadistic Middle Eye, eliciting anger from Zero Wolf, who threatens his fellow raider with death if he kills another captive without permission. As the party approaches the Mayan city from which the raiders come, they encounter razed forests and failed maize crops, along with villages decimated by an unknown disease. A little girl (MarÃ­a Isidra Hoil) infected with the illness prophesies Zero Wolf's death and the end of the Mayan world. Once the raiders and captives reach the city the females are sold as slaves while the males are escorted to the top of a step pyramid to be sacrificed before the Mayan King (Rafael Velez) and Queen (Diana Botello).
As a result of a solar eclipse and the superstitions surrounding it, Jaguar Paw and the remaining captives are spared from being sacrificed by beheading. Instead, they are ordered to be taken away and "disposed of." They are offered freedom if they can avoid being killed during target practice by Zero Wolf and his men. After some tribesmen are killed, Jaguar Paw is severely injured but kills Zero Wolf's son Cut Rock (Ricardo DÃ­az Mendoza) and escapes into the jungle. Zero Wolf sets off with eight comrades to chase down and kill Jaguar Paw. Back in his native jungle, Jaguar Paw now has the advantage, although he is badly injured. Most of his pursuers are gradually killed off via clever conceits and traps laid out by Jaguar Paw until there are only two left to hunt him.
The drought breaks and heavy rain begins to fall, threatening to drown Jaguar Paw's family, who are still trapped in the pit cave despite their attempts to escape. Seven gives birth to another son, who is born into the now dangerously rising water. Meanwhile, the two remaining raiders chase Jaguar Paw out of the undergrowth towards the coast. As they reach the beach, all three are stopped in their tracks by the sight of conquistador ships anchored off the coast and Europeans making their way ashore holding up a large cross. Jaguar Paw escapes while the two raiders remain, seemingly mesmerized at the conquistadors' presence. Jaguar Paw returns in time to save his family from the flooded pit. He is overjoyed at the sight of his new baby son.
Sometime later, as the reunited family look out over the water at the Spanish ships, Jaguar Paw decides not to risk approaching the conquistadors, insisting his family head back into the jungle. They depart in search of a new home.

Question: Why are the captives and Jaguar Paw spared from sacrifice?
Answer: Solar eclipse