BERLIN — Austria, Slovakia and the Netherlands introduced border controls on Monday, as Germany’s decision over the weekend to set up checks began to ripple across a bloc struggling to deal with the influx of migrants coming to the Continent.

In Hungary, the authorities said that a near-record 5,353 migrants had crossed into the country from Serbia before noon on Monday — even as Budapest continued to seal off that border with the construction of a 109-mile fence made with razor wire.

Around 50 police officers, wearing riot gear and equipped with pepper spray, converged Monday afternoon on the train tracks linking the villages of Roszke, Hungary and Horgos, Serbia, which thousands of migrants had used to cross in recent days. An official in a bright yellow jacket turned away migrants seeking to enter Hungary.

Starting Tuesday, Hungary will classify unauthorized entry into the country as a criminal offense, punishable by up to three years in prison. In response, Serbia said it would set up reception centers in the north of the country and pleaded for the European Union, of which it is not a member, to take action.