During the Philippine Revolution, Celso Resurrección, a Spanish mestizo, falls in love with Feliza Reyes, the daughter of a Katipunero. He joins the Spanish Army in the hopes of being sent to Spain after the war to search for his father, a plan that brings him to a remote garrison in Baler led by Captain Enrique de las Morenas y Fossí. The garrison is isolated and unaware they have lost the Spanish–American War.
They are joined by the town priest, Padre Gomez. Gabriel Reyes, Feliza's brother, becomes Padre Gomez's sacristan, much to Daniel Reyes's disappointment. Celso recognizes Gabriel and urges him to leave, but Gabriel says that his Christian duty is to stay and help Gomez, and the Spaniards allow him to stay but tell him he can leave if he chooses to.
Over the coming weeks, several attempts are made by the Filipinos to coax the Spaniards to surrender, offering safe conduct. As months pass, the hot climate spoils their food supply, and the soldiers risk being shot when they forage at night for fruits, berries, and herbs. One night, Morenas orders Celso and another soldier on a foray to burn nearby houses to distract the Filipinos and show them that their spirits are not broken. Celso takes this opportunity to see Feliza, who hands him food from the town fiesta held earlier that day as a ploy to entice the Spaniards to give up.
The womenfolk complain to the Filipino leaders that they have not heard mass in months. Succumbing to pressure, the Filipinos convince the Spaniards for an hour-long truce to allow Padre Gomez to say mass outside the church. But weakened from the deteriorating conditions inside the church, Padre Gomez dies before the mass is finished, and the truce ends as soldiers bring him back inside. At this point, Gabriel is finally convinced to leave the church. His family rushes to greet him, while Daniel breaks down and embraces him.
A ceasefire is held on Christmas. On Christmas Eve, a carabao is spotted in front of the church door, which the Spaniards take in for food. However, they are decimated by disease. Morenas succumbs to beriberi and is succeeded by Lt. Saturnino Martín Cerezo. To convince them that the war is over, the Filipinos leave newspapers on the church steps which report Spain's defeat, as well as Spanish nationals who unsuccessfully try to convince Martin. Martín's soldiers remain loyal to him, despite their dire situation.
One night, the Spaniards hear gunshots from outside and celebrate, unaware that the Philippine–American War has broken out and the Americans are trying to invade. However, their hopes are shattered when the Filipinos beat back the Americans. As morale weakens, a few soldiers plan to escape, including Mauro, who learns that Feliza is pregnant but is unaware that she has given birth to a son she names Celso. On the night of the desertion, six soldiers desert their posts while everyone is asleep. The sentry Martin catches Celso and Mauro about to escape. Terrified, Mauro accuses Celso of aiding the desertion. Celso is shot by Mauro on Martin's orders.
That evening, Martín reads an article concerning a close friend's posting, which convinces him the newspapers are genuine and that Spain lost the war. The next day, he assembles his men and informs them of the truth. Martin and his troops surrender to the Filipinos, to great rejoicing. As Feliza scans the soldiers' faces, she fails to see Celso. She runs inside the church and finds his body in the baptistry, sending her into mourning.
A few years later, Feliza is shown raising Celso Jr., while an American soldier compliments him.