The world's largest economy has retained its position as a "flawed democracy" for the second consecutive year, but freedoms are in danger of sliding further, according to the Economist Intelligence Unit.

The research firm's annual study of global democracy, released on Wednesday, showed the U.S. ranking 21st in 2017 — the same as the previous year and tying with Italy.

Years of declining trust in public institutions well before President Donald Trump took power led the EIU to demote the U.S. from a full democracy to a flawed democracy — a nation it defines as having free elections but weighed down by weak governance — for the first time in 2016.

While that remains in place today, risks are now intensified under Trump's administration, the group said.

"If Mr. Trump is unable to reverse the trend towards increasing social polarization, U.S. democracy will be at greater risk of further deterioration," the EIU said in its report, referring to the extreme divides between Republicans and Democrats on issues such as immigration and environmental regulation.

Such policy divergences have made it difficult for the Trump administration to govern effectively despite boasting a congressional majority. As a result, Washington fared poorly on the EIU's "functioning of government" category, one of the five sectors used to assess countries. Other criteria included political participation, civil liberties and the electoral process.