The troops' main role will be to protect a training centre in Iraqi Kurdistan's capital, Arbil.
The mission, which needed approval by a two-thirds majority in Hungary's parliament, passed by 137 votes to 57 with the help of opposition MPs.
Most of no votes came from opposition Socialists and the far-right party, Jobbik.
"The Islamic State is a threat to the world, and has to be taken seriously," Hungary's foreign minister Peter Szijjarto told journalists after the vote.
Also Read
They are expected to stay until in December 2017.
Last year Hungary sent ammunition to Iraq to help the country's armed forces in their fight against IS militants.
The EU and NATO member also provided military support to the US-led war in Iraq in 2003, and in 2005 donated tanks and armoured personnel carriers to the country.
Hungary also had a sizable contingent in Afghanistan until 2013.