VIENNA (Reuters) - Austria agreed on Friday to provide equipment and personnel to help Hungary secure its Schengen border and prevent illegal immigration, an Austrian Defence Ministry spokesman said.

Since the height of the refugee crisis last year thousands of refugees have crossed into Hungary - an eastern outpost of Europe's passport-free Schengen zone - many of them heading further west to more prosperous countries like Austria.

The influx of migrants and refugees fleeing devastating conflicts in the Middle East and Africa has strained relations between the two EU neighbors. Former Austrian chancellor Werner Faymann last year likened Hungary's treatment of migrants to the Nazi deportations of Jews in World War Two.

The Austrian government also adopted a tougher course on migrants, capping the number of asylum applications it would accept this year to 37,500, less than half the 90,000 refugees it took in last year.

But at a meeting in Sankt Martin an der Raab in the Austrian state of Burgenland, about 5 kilometers (3 miles) from Hungary, ministers agreed to increase cooperation on Hungary's southern and eastern borders.

They also discussed conditions under which Austria could send back refugees who initially applied for asylum in Hungary but moved on to the Alpine republic afterwards, a spokesman for Austria's Interior Ministry said.

Two working groups were formed to provide concrete proposals within four weeks.

(Reporting by Kirsti Knolle; Editing by Dominic Evans)