Minnesota Rep. Keith Ellison lost his bid to lead the Democratic National Committee as its chair on Saturday after a monthslong campaign that would have positioned him to determine the direction of the party as it tries to rejuvenate itself.

In a close contest at the DNC meeting in Atlanta, Ellison lost 235-200 to Tom Perez, the former Obama Administration Labor Secretary. The winner was determined by the first to win 218 votes. However, in one of his first acts after being elected, Perez offered Ellison the position of deputy chair, which he accepted.

Ellison will continue to hold his congressional seat, the Minneapolis Star-Tribune reported. He had said that he would leave it if he were elected.

“I’m asking you to give everything you’ve got to support Chairman Perez,” Ellison said.

Keith Ellison’s Run to Lead Democrats Met With Praise and Criticism

Ellison, the first Muslim to serve in Congress, had been a frontrunner for the party leadership and had won with the support of major party leadership like Sen. Bernie Sanders of Vermont, Sen. Elizabeth Warren of Massachussets and Democratic minority leader Sen. Chuck Schumer of New York.

But Perez, a favorite of others who had worked closely with former President Obama like former Vice-President Joe Biden and former Attorney General Eric Holder, was also able to gain late support from state parties like Florida, Kentucky and Mississippi, the Star-Tribune said.

Ellison congratulated Perez in a post on Twitter, calling for party unity.

Prior to the vote, Ellison spoke to the more than 440 voters at the meeting warning that Democrats need to unify in the face of the challenges presented by Donald Trump’s White House.

We believe we would rather have a million donations of $10 than 10 donations of $100,000. We got to go to the grass roots, y’all. Unity is essential … Trump is right outside this door, not just Trump but Trumpism. We gotta understand that it’s not just one fight.”

Obama offered his congratulations to Perez in a statement after the vote was over.

Now at the helm of the Democratic Party, replacing strategist Donna Brazile, who had been interim chair after the resignation of Rep. Debbie Wasserman Schultz last summer, Perez is charged with regrouping the party, rebuilding state parties and positioning it to take back congressional seats in the 2018 midterm elections and the White House in 2020.

“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,” he said.

[THE SPIRITUAL LIFE] From Catholic to Muslim: Congressman Keith Ellison Speaks

With AP.