Hungary follows the United States, which withdrew from talks last year. In an interview with Euronews, Hungary's foreign minister says that the migration pact is "biased" and "presents migration as a human right".
Hungary will quit the United Nations migration pact before its final approval, the Hungarian government announced on Wednesday.
Budapest said the accord posed a "threat to the world".
Its right-wing nationalist government has been one of the strongest critics of the European Union's migration policy. In 2015 it fenced off Hungary's southern borders to keep out migrants.
Its latest move follows the Trump administration in the US, which left the UN migration pact in 2017.
In an interview with Euronews, Hungary's foreign minister Péter Szijjártó said his country was leaving talks to make a pact because the text was "biased and unbalanced" and "tries to portray migration as something good by definition and as a fundamental human right, which it is not."
One solution to the migration crisis currently in vogue is the establishment of so-called "disembarkation platforms" in an African country to screen migrants. Hungary supports the proposal, but there appears to be little appetite among African countries to be the host country.
Asked about the prospects of this proposal, Mr Szijjártó said that the European Union should use its funding as leverage.
"We have to say: okay, you get this money, but a) you have to carry out reforms through which people will not leave your country and b) you will have to work together with us on lowering the pressure on Europe," he said.