The bill applies to students and teachers alike, as well as to staff at daycare centres, in 'teaching situations'. It was backed by a majority in two rounds of voting separated by three days, in accordance with Norway's parliamentary procedure, media including VG and Bergens Tidende report.
Representatives from the Socialist Left, Red and Green parties voted against the bill.
The Socialist Left voted in favour of applying the ban to teaching staff but not to students.
The anti-immigration Progress Party expressed its delight at the passing of the bill.
“This is very good news. When Progress in 2003 proposed a total ban on the niqab and burqa, we were laughed at. We see now that we have succeeded in bringing the political environment around to our viewpoint,” Åshild Bruun-Gundersen, an MP with the party, told Bergens Tidende.
“In a few years' time, we believe that Norwegian politicians will be ready to pass a total ban on the niqab in public,” Bruun-Gundersen added.
Such a ban was passed by Scandinavian neighbour Denmark last week and was criticised by human rights groups including Amnesty International.
The niqab is a full veil with a small slit for the eyes, while the burqa is a full veil that covers the head and body with a mesh screen over the eyes.
Norway's ban on the veil in schools met with some resistance from educational institutions during the parliamentary presentation stage.
The Norwegian School of Economics called it “strange and dramatic”, while the University of Bergen and Norwegian University of Science and Technology both said it was unnecessary. The University of Agder and Norwegian Police University College also spoke critically of it, VG reports.
The then-proposed ban was originally announced last year.
“The ban is a clear signal that in Norway we expect to see each other's faces. We will continue to work towards a total ban, and believe several parties will be ready for that in a few years' time,” Bruun-Gundersen told Bergens Tidende.