The judges have told Bosnia to amend its electoral laws
Bosnia's constitution discriminates against Jews and Roma, the European Court of Human Rights has ruled.
The constitution had prevented two Bosnian men - one Jewish and one Roma - from running for election to parliament or the presidency, the judges found.
Only Bosniaks (Bosnian Muslims), Serbs and Croats can get elected to the top bodies under the constitution, brought in under the 1995 Dayton peace deal.
Bosnia-Hercegovina has to meet EU standards if it is to join the bloc.
The case was brought in 2006 by Jakob Finci, a Jew, and Dervo Sejdic, of Roma (Gypsy) origin.
Bosnia's electoral commission told Mr Finci in January 2007 that he was ineligible to stand in the elections because of his Jewish origin, the court in Strasbourg said.
The court recognised that Bosnia's constitution was designed to restore peace, but also noted that Bosnia had agreed to comply with the European Convention on Human Rights.
Bosnia-Hercegovina joined the Council of Europe in 2002 and had pledged to "review the electoral legislation within one year," the ruling said.
That commitment to electoral reform was reiterated when the country signed a Stabilisation and Association Agreement with the EU in 2008, the judges noted.
A senior legal adviser at US-based Human Rights Watch, Clive Baldwin, said the court had "made it clear that race-based exclusion from political office, such as that suffered by Jews and Roma in Bosnia, has no place in Europe".
"The US, EU and the other states who still play a major role in Bosnia, should ensure the ruling is put into immediate effect by backing a change in the constitution."