The National Assembly of Republika Srpska, the Serb-run half of Bosnia and Herzegovina, voted on Thursday to establish its own border and customs service, a step that would duplicate one of the few institutions the 1995 Dayton peace agreement reserved for the central state and that Western diplomats described as the most serious test of the accord in years.

The bill, which passed 52 to 23 after a nine-hour session, directs the entity’s government to deploy officers at crossings with Serbia and Croatia within six months and to collect customs duties into an entity account. Its sponsors said the state border police, which is based in Sarajevo and staffed by all three of Bosnia’s main ethnic groups, had become “a political instrument.”

“We are not leaving Bosnia,” said Dragan Lukić, the leader of the assembly’s governing majority. “We are leaving the fiction that institutions run from Sarajevo serve the Serb people. The border of Republika Srpska will be guarded by Republika Srpska.”

Opposition members walked out before the vote. Mirjana Kovačević, one of them, said the law was unconstitutional on its face and would be struck down by Bosnia’s Constitutional Court, as a dozen similar measures have been. “Every one of these laws is written to be annulled,” she said. “That is the business model. A law, a ruling, a crisis, an election. The customs revenue is a detail.”

The Office of the High Representative, the international body that oversees implementation of the Dayton agreement, said in a statement that the law “has no legal effect” and warned that officials who attempted to implement it could face sanctions. The E.U. delegation in Sarajevo said the vote “moves Bosnia and Herzegovina further from the path it has chosen,” a reference to the country’s candidacy for membership, which has been stalled since 2024.

The practical effect of the vote is uncertain. Republika Srpska has in the past passed laws asserting control over the judiciary, taxation, and the state’s indirect tax authority, and has rarely moved to implement them before the courts intervened. But Adnan Hadžić, a political scientist at the University of Sarajevo, said the border measure was different in kind. “Customs is where the money is,” he said. “The state budget runs on indirect taxes collected at the border. If the entity takes even a share of that, the state cannot pay its own police. That is not symbolism.”

At a café near the assembly, Milan Đurić, 44, a truck driver who crosses into Serbia twice a week, said he had stopped following the debate. “I show my papers to whoever is in the booth,” he said. “If they change the flag on the uniform, the line will be the same.”