Hong Kong has been ranked 16th in the world for its rule of law - three places ahead of the United States, well ahead of the mainland, but behind tightly controlled rival Singapore.
Hong Kong's best ranking was in the category of providing order and security and its lowest was for guaranteeing fundamental rights. The mainland ranked 76th out of 99 countries studied by the World Justice Project.
The findings came from more than 100,000 household and expert surveys conducted around the world to measure how the rule of law was experienced in everyday life.
This was assessed through 44 indicators grouped under eight themes: constraints on government powers, absence of corruption, open government, fundamental rights, order and security, regulatory enforcement, civil justice and criminal justice.
Denmark led overall, followed by its fellow northern European countries of Norway and Sweden. Hong Kong, where 1,006 people were interviewed, ranked fourth in Asia. Singapore was 10th globally, while Japan and South Korea took the 12th and 14th places respectively. The US came 19th, following France.
In the area of order and security, Hong Kong ranked fourth worldwide, a drop from second in the 2012-13 report. The city also saw a slight decline in the area of constraints on government powers, to 24th worldwide this year from 22nd in the last report.
For the fundamental-rights category - which measures indicators such as effective enforcement of laws that ensure equal protection, freedom of opinion and expression, labour rights and elimination of discrimination - Hong Kong came in 29th, a slight improvement from 31st in the previous report.
The city was outpaced, however, by Singapore in almost all aspects except in the open-government category, where Hong Kong was 10th compared with the Lion City at 21. Singapore ranked second in the world for providing "order and security", behind Japan.
The mainland scored best in order and security, ranking 29th in the world. It did worst in constraints on government power, coming in at 92nd place.
The report is the fourth in an annual series. Overall global ranks were reported for the first time this year. Hong Kong has been covered in the study since 2011. Macau and Taiwan were not included.
"Effective rule of law helps reduce corruption, alleviate poverty, improve public health and education, and protect people from injustices and dangers," World Justice Project founder and chief executive William Neukom said.
The US-based independent research organisation aims to advance the rule of law around the globe.