Increasingly desperate, the woman had already tried to escape once.

But her husband grabbed her by the hair and pulled her back into the house they shared in Franklin County, Mo., according to Fox-affiliate KSTU.

For 15 hours, he beat and sexually assaulted her.

He put a gun to her head and threatened to shoot her, then himself, the news station said. He forced her to take off all her clothes.

Through it all, their 3-year-old son was locked in a bedroom without food or water.

It’s unclear what sparked the particularly violent bout of abuse, but authorities say it might have ended in disaster if not for a deliveryman’s knock at the door.

The UPS driver came to the one-story house just before noon on Tuesday to pick up a package.

As the woman talked to the driver, her husband, later identified as James Jordan, stood behind her with a gun, the station reported.

Somehow, she managed to scrawl on the box: “Contact 911.”

The driver did, and now sheriff’s deputies are calling him a hero.

“He made a huge difference,” Franklin County Sheriff’s Sgt. T.J. Wild told St. Louis CBS-affiliate KMOV.

The driver also received praise from his company:

“We are grateful this UPS driver with more than a decade of service followed protocol when he saw a customer in distress and contacted authorities after he saw her message to contact 9-1-1,” the company said in a statement.

“Our drivers are very familiar with their routes, and are trained to be aware of their surroundings and respond to requests for assistance.”

Responding to the driver’s call, sheriff’s deputies came to the home on Willow Ford Road in the Robertsville area, about 50 miles southwest of St. Louis.

They started talking with the woman, but her husband closed the door on them “and refused to cooperate,” according to the St. Louis Post-Dispatch.

The deputies worried that Jordan was capable of violence because he had been arrested for assault before. They also believed that he had a .45-caliber pistol in the house. So they called for the SWAT team.

Jordan surrendered before SWAT members got there.

He is charged with domestic assault, sodomy, felonious restraint, unlawful use of a weapon and endangering the welfare of a child. He was in Franklin County jail with bail set at $100,000.

The woman’s story is reminiscent of an incident this year in which a woman being held hostage tried to get help with a note.

In October, an 11-year-old gave a note from her mother to school officials in rural Louisiana, according to The Washington Post. The woman said she was being held captive by a man in a mobile home.

Officials sent police to the home, where they found the woman being held against her will.

In the end, Donald Ray Guy was charged with false imprisonment and domestic abuse battery. The woman had gone to the home willingly, police said, but Guy wouldn’t let her leave.

Read more:

‘Moved by the message,’ a man tried to kill his father during altar call in a Kentucky church

This officer shot and paralyzed an unarmed man. For 11 minutes he didn’t tell anyone.