ATLANTA – ATLANTA – Democrats chose President Obama’s former Labor secretary, Tom Perez, as the person to lead them out of a political wilderness of heavy losses at every level of government over the past eight years and amid tensions between moderates and progressives about how to rebuild the party after Hillary Clinton's unexpected loss to Donald Trump.

Perez’s election as the next Democratic National Committee chair is a reflection of the party’s leftward drift – all of the contestants packaged themselves as progressives eager to tangle with Trump on voting and civil rights and economic policies favoring the wealthy.

Perez won narrowly in a second round of balloting after coming one vote short of a majority in an initial round. A group of supporters for his opponent, Keith Ellison, co-chairman of the Congressional Progressive Caucus, reacted angrily and stormed out of the room chanting “no big money. Party for the people.”

Within moments, Perez announced he would make Ellison a deputy chair as the room erupted in applause.

Ellison urged everyone to support Perez. “If we waste even a moment going at it over who supported whom we are not going to be standing up for those people,” referring to struggling Americans, he said.

A former Department of Justice civil rights lawyer, Perez emphasized fighting against former Sheriff Joe Arpaio in Arizona on immigration issues, stopping voter ID laws and taking on Wall Street in the aftermath of the foreclosure crisis.

Yet he was also the more establishment-aligned alternative in what had essentially become a two-way race in its final stretch. Former Vice President Joe Biden and former Attorney General Eric Holder endorsed Perez. Ellison was the favorite of Vermont Sen. Bernie Sanders and other progressive leaders, including Sen. Elizabeth Warren, D-Mass.

Ellison's confrontational style raised some concerns about his ability to connect with white working-class voters in the Rust Belt states that flipped to Trump in 2016. Pennsylvania, for example, hadn’t voted for a Republican president since 1988.

The greatest challenges facing the next leader is uniting Democrats and rebuilding a party infrastructure in need of a major overhaul. Democrats not only lost the White House but also both chambers of Congress in the past couple elections. At the state level, they now control the legislature in just 13 states, compared to 32 controlled by Republicans amid widespread complaints the DNC focused it resources on presidential races at the expense of local party building.

"We are suffering from a crisis of confidence, a crisis of relevance. We need a chair who can not only take the fight to Donald Trump," Perez said in a final appeal to DNC members. "We also need a chair who can lead turnaround and change the culture of the Democratic Party and the DNC," said Perez, emphasizing the importance of "working to elect from the school board to the Senate."

The aftermath of the vote — and whether Ellison supporters embrace Perez — is an initial test of party unity needed to take on Trump and the Republican-led Congress. Party officials and keynote speakers made no attempt to conceal tensions between some Perez and Ellison supporters.

“There’s no secret that there’s division, even in this camp,” said Rev. Bernice King, the daughter of Martin Luther King, Jr., who addressed the crowd ahead of the vote. “We came here in different ships and boats but we’re all in the same boat now,” King said. “If we don’t come together as brothers and sisters, we’re going to perish as fools."

Perez consolidated support in the final moments of the race when South Bend, Ind., mayor Pete Buttigieg, a dark horse who drew significant attention, helped avoid a drawn out series of balloting by withdrawing his nomination.

Just as the Republican Tea Party pulled the GOP further to the right, there is a progressive tug to the left after a heated primary battle between Clinton and Sanders, who frequently drew connections between her and Wall Street interests.

“Bernie did not get a fair shake” from the DNC leadership, said Brian Ellison, a Detroit pastor and one of Keith Ellison’s brothers, and “people are very upset about that to this day.”

Even so, in his speech, Keith Ellison made an appeal for unity. "We’ve gotta walk out of here with unity not just between the candidates” but between party members, he said. "Trump is right outside that door — and not just Trump but Trumpism.”

"You are the ones who can bring comfort to people fearing a ban or a wall or losing their Social Security," Ellison added. "The American people need us in this moment," he said.

If the vote is fair and “transparent there will be unity,” assured Ellison's brother, who huddled with other supporters in the back of conference room.

Many wearing green Ellison shirts expressed similar sentiments. Still some, including Ohio state senator Nina Turner, warned that “if Congressman Ellison is not elected there’s lots of people who are prepared to walk.” The divide between progressive and more moderate members was also on display in a debate over an amendment about DNC rules governing accepting corporate money that was voted down, with some members chanting “money out of politics.”

The question going forward is whether the party divide is significant to rival the Tea Party. In the first couple of election cycles, Tea Party Republicans who won their primary went on to lose seats to Democrats in the general election.

More immediately, the major challenge for the new chair is fundraising. The Republican National Committee raised $19.8 million in January, setting a record. While the Democratic Party’s traditional grassroots machine, labor unions, are fighting for survival, Republicans have built a powerhouse of outside groups like the Koch Brothers-funded Americans for Prosperity that is bolstering local GOP officials from county commissioner to governor.

“We’ve got a tremendous wind at our back. Not only do we hold large majorities but the enthusiasm I’m seeing among the grassroots among state and county committee people and this new insurgence of Trump supporters is like nothing I’ve ever seen,” said Val DiGiorgio, chair of the Pennsylvania Republican Party.

Democrats are expecting the new DNC chair to help reinvigorate local parties who’ve complained that national outside groups, like Obama’s Organizing for Action, have drained talent and resources resulting in a disproportionate share of resources going to presidential candidates.

The DNC needs “an overall culture change to get out of the Washington-centered model they have” said Michigan chair Brandon Dillon. “The basic capacity for state parties to do what state parties should be doing has really eroded over the past decade,” said Ohio chair David Pepper.

The forum also spotlighted a number of potential rising stars in the Democratic Party. California Attorney General Xavier Becerra, who's expected to lead many of the legal battles against the new administration, delivered the keynote address.

Boston Mayor Marty Walsh and former Missouri Secretary of State Jason Kander, who narrowly lost his 2016 Senate race, also gave speeches. Kander has started a new national voting rights organization.

“There’s something happening in this country right now,” Kander said. “This is a level of activism most of us have not seen in our lifetimes,” he said. “We may be living in the nightmare that is the Trump presidency, but we are awake, we are on our feet and we are marching forward,” he said.

Buttigieg may have been the break-out star after withdrawing his nomination. In his speech, he called for healing even with Trump voters. “The world is not divided into good people and bad people. Every one of us can and will do good things and bad things every day,” Buttigieg said.

“Leaders matter because of what they bring out in the rest of us,” Buttigieg said. "Right now we have leaders who bring out the worst in us. They call on the darkest things within us,” he said, calling on Democrats to become “happy warriors.”