A Peter Pan bus driver locked a Boston-bound passenger inside a baggage compartment — forcing the trapped traveler to call 911 to get out, authorities said.

Driver Wendy Helena Alberty, 49, was apprehended Sunday on a bus in Wilmington, Conn., after her victim called the cops while still in the compartment, news station WBZ-TV reported.

The unharmed rider climbed out and told police that “she had been purposely locked inside by a female driver while attempting to retrieve items from her bag,” authorities said.

When the bus was pulled over, Alberty wasn’t driving but was aboard the bus, officials said.

She was charged with breach of peace, reckless endangerment and unlawful restraint, according to cops. She’s being held on $2,000 bail and set to appear in court Aug. 21.

The bus company issued a statement Monday to The Post in response to the incident.

“The operator in question is currently on investigative suspension as we continue to investigate all aspects of this incident as well as cooperate with Connecticut State Police,” the company said. “This operator has been with Peter Pan Bus Bus Lines since 2012 and has been an exemplary employee or the company.”