There they go — a series of vulgar e-mails has toppled the leaders of the Miss America pageant.

The pageant’s executive chairman, its president and the chairwoman of its board all resigned on Saturday.

The departures came two days after the Huffington Post published crude and demeaning e-mails Miss America executives and employees wrote about former pageant winners.

Most of the e-mails involved pageant CEO Sam Haskell, who also held the title of executive chair of the Miss America board.

Haskell wrote, “Perfect . . . bahahaha,” in reply to a subordinate’s August 2014 e-mail that called ex-Miss Americas “c—s.”

The Miss America board on Saturday accepted Haskell’s resignation “effective immediately.”

Miss America 2013 Mallory Hagan — who was the object of sex gossip by Haskell and other pageant execs — learned of his departure as she spoke to a Post reporter Saturday afternoon.

Hagan credited the change at the top of the organization to pressure by Miss America winners — 49 of whom called for Haskell’s departure.

“I feel like collectively, the Miss Americas are badass!” Hagan said. “Don’t mess with a group of empowered women!

“Wow. I feel like we are taking the organization back,” she added. “For the longest time, all these things were being said about us, when this is our organization. Our face is on the forefront. We deserve for it to be run the way it should be.”

Hagan, a former Miss New York, told The Post that she knew Miss America execs were maligning her behind her back, but that she could never prove it.

That was until a set of August 2014 e-mails came out in which a pageant employee wrote to Haskell and two co-workers, “Are we four the only ones not to have f–ked Mallory?”

Haskell answered, “It appears we are the only ones!”

Haskell’s No. 2, Josh Randle — whose title was Miss America president — also announced his plans to quit on Saturday.

Randle, 29, became the youngest president in the organization’s history in May. It was unclear Saturday afternoon whether the board accepted his resignation.

In a January 2015 e-mail exchange with Haskell, Randle disparaged what he thought was Hagan’s inappropriate weight gain.

“She’s a healthy one!! ­Hahaha,” Randle wrote.

He said in a statement, “I apologize to Mallory for my lapse in judgment.”

The board also accepted the resignation of its chair, Lynn Weidner, for ­e-mails undermining Hagan’s pageant-coaching business.

Weidner will stay on for 90 days to ease the transition to a successor, the pageant said in a statement.

Dan Meyers, who has served as the board’s vice chair, said he would step in as interim chair.