Former Labor Secretary Tom Perez defeated Congressional Black Caucus member Rep. Keith Ellison, D-Minn., on Feb. 25 to become the next chairman of the Democratic National Party after a tense race that mirrored dynamics of the 2016 presidential primary.

Former Labor Secretary Tom Perez, who is a candidate to run the Democratic National Committee, speaks during the general session of the DNC winter meeting in Atlanta, Saturday, Feb. 25, 2017. (AP Photo/Branden Camp)

Perez prevailed on the second ballot with 235 votes after falling just short of the 218 votes needed for a majority on the first ballot. Ellison obtained 200 votes.

“It is an unmitigated pleasure and privilege to take this gavel. And I recognize that I have a lot of work to do. I recognize that I have a lot of learning to do. And I would simply ask that everyone across America – whether you’re Democrat or Republican, unaffiliated…another party – to simply listen to our message; come with an open mind because the values of inclusion and opportunity, we share those values,” said Perez in his victory speech which was captured on video by TheHill.com. He added, “And when we lead together, that is how we succeed.”

President Obama congratulated his former cabinet member on his victory.

“I know that Tom Perez will unite us under that banner of opportunity, and lay the groundwork for a new generation of Democratic leadership for this big, bold, inclusive, dynamic America we love so much,” Obama said in a statement.

The former civil rights attorney, who served in the Justice Department under former U.S. Attorney General Eric Holder, faces a daunting task: leading the Democratic Party in regaining and gaining ground in towns, cities and states across the country, as well as in Washington, where Republicans control both houses of Congress and the White House.

The Marylander also will have a tough job of re-knitting a party fractured during the contentious White House contest between former Secretary of State Hillary Clinton and U.S. Sen. Bernie Sanders (I-Vt.). Many left-of-center Democrats who supported Sanders remain convinced the Democratic primary—under the aegis of then-DNC Chair Rep. Debbie Wasserman Schultz (D-Fla.)—was rigged in favor of Clinton.

Rep. Keith Ellison, D-Minn, who is a candidate to run the Democratic National Committee, speaks during the general session of the DNC winter meeting in Atlanta, Saturday, Feb. 25, 2017. (AP Photo/Branden Camp)

Rep. Keith Ellison, D-Minn, who is a candidate to run the Democratic National Committee, speaks during the general session of the DNC winter meeting in Atlanta, Saturday, Feb. 25, 2017. (AP Photo/Branden Camp)

Like his former Obama administration colleague, Perez was mostly supported by the “establishment” of the Democratic Party, gaining endorsements from former vice president Joe Biden and Holder.

Likewise, Ellison—the first Muslim elected to Congress and a respected grassroots organizer—was backed by the progressive wing of the party, which also supported Sanders.

Sanders congratulated Perez but urged him to be more open in his approach to leadership.

“At a time when Republicans control the White House, the U.S. House, U.S. Senate and two-thirds of all statehouses, it is imperative that Tom understands that the same-old, same-old is not working and that we must open the doors of the party to working people and young people in a way that has never been done,” Sanders said in a statement.

Both candidates also stressed unity in their remarks during the election, and Perez made Ellison his deputy chair in his first act as chairman.

“Unity is essential. We have to walk out here unified, not just between the candidates but the groups that support all the candidates,” Ellison said.

Added Perez, “We are one family and I know we will leave here united today…. no matter who wins I know we’ll cross the finish line together because a united Democratic Party is not only our best hope, it’s a Donald Trump nightmare.”