MTI via AP, Szilard Koszticsak
Serbian Prime Minister Aleksandar Vucic, right, and his Hungarian counterpart Viktor Orban inspect the honor guards during the welcoming ceremony in front of the Parliament building in Budapest, Wednesday, July 1, 2015. Vucic is on a one-day official visit to Hungary.

BUDAPEST, Hungary — Hungary's prime minister says the fence his country wants to build on the Serbian border to stem the flow of illegal migrants is a "forced measure" not aimed at its southern neighbor.

Prime Minister Viktor Orban, who took part Wednesday with Serbian Prime Minister Aleksandar Vucic in a joint government meeting, said he believed the issue of large-scale migration toward Europe would be an enduring problem.

Vucic said the fence was "not pleasant" for Serbia and that controls would be increased at Serbia's border with Macedonia, where many of the migrants and refugees enter his country.

Hungary says that police have detained more than 67,000 illegal immigrants this year, nearly all arriving from Serbia, including an average of more than 1,000 people a day over the past week.