By Adrian Croft

BRUSSELS (Reuters) - Bosnian leaders moved to clear the main obstacle to their country applying to join the European Union on Tuesday by agreeing to end a constitutional ban on minorities running for high office.

Bosnia trails its fellow former Yugoslav republics in the quest to become a member of the bloc, for years the main driver of reform and stability in the Balkans by offering the hope of prosperity, investment and freedom of movement.

Its application has been blocked by its failure to change the constitution in line with a 2009 ruling by the European Court of Human Rights that parts discriminated against groups like Roma and Jews.

Seven leaders from Bosnia's main parties met officials in Brussels on Tuesday and agreed on "the necessity to implement the judgment urgently by providing every BiH (Bosnia-Herzegovina) citizen with the right to stand for election to the ... Presidency and House of Peoples".

Their joint statement did not go into further detail on how or when the changes would be made. The leaders promised to work out details of the agreement before resuming talks in Brussels on October 10.

EU enlargement chief Stefan Fuele said he hoped the agreement would make it possible for the European Commission to issue a positive annual report on October 16 on Bosnia's progress towards meeting EU standards on democracy and human rights.

He hoped the report would "open the way for a credible application of Bosnia-Herzegovina to become a member of the European Union".

FUNDING AT STAKE

Failure to amend the constitution has stalled Bosnia's application to become a formal candidate for membership and to eventually begin accession talks.

EU officials had also begun warning of a cut off in potentially hundreds of millions of euros in funding from the bloc for reforms and local development.

Having the anchor of an EU accession process and the reforms that are inherent is crucial to attracting much-needed foreign investors to an economy still recovering from the 1992-95 war.

Of Bosnia's immediate neighbors, Croatia joined the EU in July, Montenegro has begun accession talks and Serbia expects to by January.

Bosnia has been governed along ethnic lines since the war that killed an estimated 100,000 people and split the country into two autonomous regions, linked by a weak central government.

The Brussels agreement came as Bosnia launched its first census as an independent state, a politically charged event that has revived ethnic rifts.

(Reporting by Adrian Croft; Additional reporting by Matthew Robinson in Belgrade; Editing by Andrew Heavens)