Thousands of migrants remain stranded at Budapest's main international railway station as Hungarian authorities are sticking to European Union rules and preventing them from leaving for Germany and other countries west.

Around 3,000 migrants were at the Keleti station in the Hungarian capital early Wednesday, many sleeping outside the main entrance guarded by police, who said citizen patrols were now assisting them in keeping order.

Volunteer groups accustomed to providing food, clothing and medical assistance to a few hundred migrants at a time struggled with the large number of people staying in every corner of the station's sunken plaza.

More than 150,000 migrants have reached Hungary this year, most coming through the southern border with Serbia. Many apply for asylum but quickly try to leave for richer EU countries.