Democrats have elected a former labour secretary in Barack Obama's administration as their new leader - a role analysts say would be crucial to helping the Democratic Party regain federal power, which has been lost to a great degree to the rival Republican Party.

Members of the Democratic National Committee, the party's administrative and fund-raising arm, chose Tom Perez over Keith Ellison, the Minnesota Congress member, following two rounds of voting on Saturday.

Perez will face challenges in trying to unify and rejuvenate a party still reeling from the November 8 loss of Democratic presidential candidate Hillary Clinton and anxious to channel the growing grassroots resistance to Republican President Donald Trump into political support for Democrats across the country.

READ MORE: America's flawed democracy

"We are suffering from a crisis of confidence, a crisis of relevance," Perez, a favourite of former Obama administration officials, told DNC members.

He promised to lead the fight against Trump and change the DNC's culture to make it a more grassroots operation.

Perez beat Ellison, who was backed by Democratic senator Bernie Sanders, 235-200 in the second round.

Rebuilding challenge

Perez is the son of Dominican immigrants, while Ellison is the first Muslim elected to the US Congress.

Perez, Ellison and other Democrats agree on the need to rebuild the party at the state and local levels.

They say that those organisations can then capitalise on the widespread opposition to Trump by getting frustrated voters to elect more Democrats.

Al Jazeera's Shihab Rattansi, reporting from Atlanta, said that one major difference between Perez and Ellison was that the latter had "support from people who not only protested against Trump, but also against the Democratic Party, who they feel allowed Trump to win".

In a phone interview from Atlanta, Jason Johnson, a political analyst, told Al Jazeera that the election was key to determining a figure who could rebuild the Democratic Party, which is one of only two parties largely capable of being elected in the US, that has been "decimated at the state level".

"With Obama out of office, Joe Biden largely out of the political arena and the Clintons no longer being an effective brand, the Democrats really need a leader to rebuild the party at a state level," he said.