In an unprecedented move, the Jerusalem City Council voted late Wednesday to fire city attorney Yossi Havilio following a series of disputes between Mayor Uri Lupolianski and the city's top law enforcement official over controversial municipal moves. The decision by the mayor and his associates to oust Havilio, which has been strongly condemned by outside bodies including The Movement for Quality Government in Israel and Attorney-General Menahem Mazuz as well as an external ministerial committee, comes in the wake of a series of legal losses that Lupolianski has suffered over the last two years for decisions he made in defiance of the legal opinions issued by the city attorney. The dismissal will not go into effect until a Jerusalem labor court rules on the matter following a last-minute appeal the city attorney launched this week against his ouster. The 23-5 vote followed a rancorous three-hour city council meeting on the issue, which was repeatedly interrupted by hecklers on both sides. Lupolianski charged at the start of the stormy late-night meeting that Havilio - who has won accolades from top legal officials as well as from former Jerusalem Mayor Ehud Olmert, who appointed him to his job - was not "properly functioning" as the city attorney. In a tense showdown, Havilio, who attended the heavily-guarded meeting, was then allotted ten minutes to speak by the mayor. The placid but determined city attorney refused to adhere to the mayor's timetable, and was then given 20 minutes to respond to the charges. Amid repeated catcalls from haredi city council members, he addressed the gathering for nearly three-quarters of an hour, detailing his highly acclaimed record and dismissing the charges levelled against him by the mayor. "This is not a private matter relating to Yossi Havilio, nor to the Jerusalem Municipality alone, but to the public at large," Havilio said at the start of his emotional address. "The only reason I am being dismissed is because I upheld the rule of law," he added. Jerusalem opposition leader Nir Barkat said Wednesday that he would petition the High Court of Justice to stop the city attorney's ouster. "We cannot allow a situation where someone who fights corruption is sent home for enforcing the law," he said. For months, Lupolianski's associates have been trying to attain the two-thirds city council majority needed in order to oust Havilio, and had repeatedly taken the issue off the city council's agenda in the past after falling short of the required vote. The mayor's controversial decision follows a series of back-to-back legal loses that he suffered after refusing to accept various legal opinions proffered by the city counsel, including one against illegal city funding for haredi private schools in the capital. Supporters of the city attorney called the unprecedented ouster a travesty of justice and a blow to the rule of law, while his opponents said that he had to go due to his acrimonious relationship with the mayor. "This is an unprecedented nadir for the city council," said Meretz city councilman Sa'ar Nethanel. "Your dispute is not with the city attorney but with the rule of law," he told the mayor. "Even a husband and wife that don't get along divorce," countered Deputy Mayor Yehoshua Pollack, from Lupolianski's United Torah Judaism Party. "You cannot force a city attorney on the municipality," he added. Lupolianski, who controls an absolute majority in the 31-member city council, was guaranteed victory in the vote after an opposition city councilman, Meir Tourgeman from Barkat's party, said he would vote in favor. In an embarrassment for Barkat, at least two other renegade opposition members also voted to remove Havilio from his position. Tourgeman said that there was an all-out "war" between the mayor and Havilio, which had to be ended even if it meant getting rid of an honest city attorney. Havilio previously received the high-profile legal backing of Mazuz, who is the state's top law enforcement official. "From petitions that I have received from city councillors and from reverberations which have reached me from other channels, it appears that there are those in the Jerusalem Municipality... who are not comfortable with the city attorney carrying out his duties in a professional and independent manner," Mazuz wrote Lupolianski back in 2004. Havilio, who had voiced his determination to keep his job despite his frigid relations with the mayor, also has the support of The Movement for Quality Government in Israel, which has deplored earlier moves against him. "It appears that the apparent planned dismissal of the city attorney comes in the wake of his willingness to take an uncompromising stand in maintaining a worthy professional standard and to stick to his obligation to ensure that the city will operate in a legal manner and according to proper administration," reads a letter the group sent the mayor last year.