SARAJEVO (Reuters) - The Bosnian parliament on Monday approved long-delayed changes to a criminal code aimed at bolstering the rule of law and the fight against crime and corruption, which is expected to speed up the country’s progress toward European Union membership.

Bosnia’s top court had given lawmakers a June deadline to bring the country’s criminal procedure code into line with international standards, a key EU requirement for Western Balkan nations aspiring to join the bloc.

But politicians from Bosnia’s three rival ethnic parties could not agree on changes drafted by the Justice Ministry which included the use of undercover police personnel, communications interception, surveillance and the use of informants.

The EU also considered the amendments proposed by the ministry to be too weak, and warned that Bosnian prosecutors would be deprived of one of the major tools to effectively fight against the most serious crime.

A compromise solution agreed under international pressure allows the duration of investigative processes to be cut to a maximum of one year from up to 10 years previously, and reduces the scope for granting immunity to alleged offenders and witnesses.

A majority of lawmakers in Bosnia’s multi-layered parliamentary system have enjoyed immunity from prosecution and analysts in the country, which is mired in corruption, said politicians had resisted major changes to the law in order to keep this privilege.

Disputes among Bosnia’s ethnic leaders have nearly halted the Balkan country’s progress toward the EU and NATO. Bosnia formally applied for EU membership in 2016 but the process of joining is expected to take at least a decade.