PRISTINA, Kosovo (AP) — Hardline opposition supporters tried but failed to stop Kosovo lawmakers from approving a key deal with Serbia on Thursday — with hundreds clashing with police outside parliament, lawmakers scuffling with the body’s speaker inside, and some protesters even attacking the U.S. ambassador as she tried to enter the building.

The developments underscored the deep passions that arise in this tiny country over any deal with a neighboring state that still refuses to recognize Kosovo’s independence.

The agreement, which passed on an 84-3 vote, will see Serbia call off parallel security structures in the Serb-run north of Kosovo and encourage northern Kosovo’s Serb population to work with the ethnic Albanian leadership in Pristina in exchange for more self-governance. The accord does not, however, resolve the dispute over Kosovo’s 2008 secession from Serbia.

Kosovo police used pepper spray and batons to disperse a crowd of several hundred hardline opposition supporters who tried to stop lawmakers from holding the vote. Dozens of people were detained by police in riot gear outside government buildings.

U.S. Ambassador Tracey Jacobson “was physically accosted by protesters” blocking entrances to the assembly building, the U.S. Embassy in Kosovo said in a statement, adding, “We deplore the use of violent tactics in obstructing the democratic process.”

“Vetevendosje tried to stop us, but we got in on our second attempt! #bruised,” Jacobson tweeted, using the Albanian name for Self-Determination, an opposition group that is against talks with Serbia and has 12 seats in the 120-seat parliament.

Many lawmakers, including Self-Determination members, did not vote Thursday, but there were enough who did to meet the necessary quorum and pass the deal, which still requires the president’s signature.

Members of Self-Determination unfolded banners during the process suggesting the deal gives Kosovo territory to Serbia. And some in the group scuffled with the speaker of Parliament to try to prevent the vote from taking place, but security intervened and removed them.

Belgrade does not recognize Kosovo’s statehood and still officially claims the territory as part of Serbia. But both sides hope they will eventually qualify for membership in the European Union and see the agreement as a token of goodwill to overcome their differences.

Serbia’s brutal crackdown on separatist ethnic Albanians in Kosovo was halted after NATO’s 78-day air war in 1999, which forced Belgrade to give up control of the territory.