ATLANTA — One vote.

That’s how close former Labor Secretary Tom Perez was to defeating Rep. Keith Ellison (D-Minn.) on the initial ballot and becoming the next chairman of the Democratic National Committee (DNC) in the first contested race in more than a decade.

The hundreds of DNC members and liberal activists gathered inside the Atlanta Convention Center hall gasped when interim chairwoman Donna Brazile read the results. None of the candidates received a majority and there would have to be at least a second round of voting where anything could happen.

ADVERTISEMENT

When Perez supporters gathered at a party at the Westin Hotel in downtown Atlanta on Friday night, they thought they had about 220 votes, which would have given them a majority.

Instead, they clocked in at 213.5 in the first round — some Democrats abroad and from the territories only get half votes — with eight DNC members abstaining. That left the door open for Ellison, who was only 13 votes behind.

The narrow miss struck fear in the hearts of Perez supporters who were frustratingly close to victory.

Many DNC members had told the campaigns they could only count on their support through the first round of voting. After that, all bets were off, sending the whip operations for both campaigns into high gear.

With fringe candidates dropping out and DNC members susceptible to flipping, there were more than enough votes free to shift to Ellison.

“I thought Ellison would win on the second ballot,” said one Perez supporter. “I have never been involved in something that intense.”

Ellison’s campaign was confident that they would pick up all 12 of the supporters from Idaho Democratic Party executive director Sally Boynton Brown, who bowed out after the first round but notably did not endorse any candidate.

ADVERTISEMENT

Boynton Brown, who is in her early 40s, is a rising party star who fits the mold of a progressive. The conventional wisdom was that her supporters would back Ellison, who ran with the blessing of Sen. Bernie Sanders Bernie SandersMcConnell accuses Democrats of sowing division by 'downplaying progress' on election security The Hill's Campaign Report: Arizona shifts towards Biden | Biden prepares for drive-in town hall | New Biden ad targets Latino voters Why Democrats must confront extreme left wing incitement to violence MORE (I-Vt.).

“We’re going to win on the second ballot,” an Ellison campaign source said in a text. “Some folks didn’t vote in the first round and we’re getting all of Sally’s supporters.”

Perez’s allies weren’t just rattled — they were also angry.

Before the second vote, a text went out from Ellison’s campaign to DNC members claiming that South Bend, Ind., Mayor Pete Buttigieg, who dropped out before the first vote, was casting his support to Ellison.

“Keith is grateful to have the support of Mayor Buttigieg and we’re in a strong position to win on the next ballot,” the text said. “Can he count on your support?”

The problem: Buttigieg did not endorse anyone after dropping out.

One Ellison ally described the mistake as fog-of-war confusion. They quickly sent a follow-up text admitting the error.

Instead, former DNC chairman Howard Dean — who was originally a Buttigieg supporter — announced he would be backing Ellison.

Dean’s emailed endorsement included a parenthetical disclaimer: "This is real."

Perez’s supporters were irate, believing the Ellison camp was playing dirty. Some grumbled that if the Perez camp had made the same mistake, Ellison’s supporters would have never let them live it down.

“Such a double-standard,” one Democrat said.

As this drama unfolded, the whip operations on the convention hall floor had become infinitely more complicated.

The campaigns were supposed to get lists of candidates everyone had voted, for but the DNC had to abandon its digital voting tools over fears the Wi-Fi would give out.

They would go to the back-up plan of hand-counting paper ballots instead. That meant there wouldn’t be a master list of who voted for who.

ADVERTISEMENT

“Total chaos,” one Democrat fumed.

Still, the campaigns had their own lists of people they thought might be susceptible to flipping.

On the Perez side, South Carolina Democratic chairman Jaime Harrison, Texas Democratic chairman Gilberto Hinojosa and DNC finance chairman Henry Muñoz III went to work whipping.

The Perez campaign was thrilled to have Harrison drop out of the race and join their side on Thursday, believing he brought at least a dozen votes.

They think Muñoz might have put them over the top. The finance chairman, who spends his weeks jetting across the country and raising millions of dollars from wealthy donors and celebrities from Miami to San Francisco, is among the most connected people at the DNC.

On the Ellison side, key labor leaders including Randi Weingarten, as well as Rep. Barbara Lee (D-Calif.), worked the floor.

The Perez operation won out.

ADVERTISEMENT

Ellison registered 200 votes — the exact same number he had in the first round.

Perez increased his count by 21.5 votes to 235 overall. That means he likely got most of Boynton Brown’s 12 and most of the eight members who abstained from voting in the first round, as well as at least a couple of former Ellison supporters.

That helped him win the first contested DNC chair race since Dean last won in 2005.