The agreement was signed in Suzhou during this week's 16+1 summit, which brought together government ministers from across central and eastern Europe for talks with senior Chinese politicians including premier Mr Li Keqiang.
Under the 20-year loan agreement China will finance 85% of the Forints 472bn ($US 1.6bn) modernisation of the 163km line from Budapest to Kelebia on the Serbian border.
A Hungarian-Chinese joint venture including Hungarian State Railways (MÁV) will be set up to make preparations for the project, which will include track-doubling, electrification, and upgrading for 160km/h operation. Loops will also be extended to accommodate 740m-long freight trains.
Earlier this year a consortium of Főmterv and Ecoroad was awarded a Forints 527m contract to carry out a detailed feasibility study for the project. Detailed planning, authorisation, and tendering will take place next year with the aim of implementing construction in 2017-2018.
The Serbian government says it has also signed a separate deal with the Chinese government covering the modernisation of its 177km section of the route.