The final vote was taken behind closed doors after a tense, testy debate with about 20 members of the public present.