Zelensky described the talks in Uzhhorod as businesslike and said the two neighbours could support each other in many areas.
"There are many areas in which our countries can cooperate and reinforce each other. Energy, bilateral trade, humanitarian aid - today we managed to discuss all these issues", he wrote on social media.
Under the agreements, Hungary will supply gas and diesel to Ukraine, and Hungarian firms will make wider use of Ukrainian gas storage. The two sides also plan to upgrade existing border crossings, open new ones and launch direct rail links on new routes.
Hungary will also take a bigger role in the international coalition working on humanitarian demining.
"We reached concrete agreements on all these matters. We have instructed our teams to start work on their swift implementation", Zelensky said.
At a joint news briefing, Magyar said Hungary condemned Russia's aggression and was helping Ukraine in every way it could, Ukrainian news site European Pravda reported. He announced an aid package for Zakarpattia that includes medical equipment, generators and vehicles.
He added that talks with Kyiv on the language, cultural and educational rights of Ukraine's Hungarian minority, about 100,000 people, many of them in Zakarpattia, had made significant progress.
Magyar, accompanied by Hungarian Foreign Minister Anita Orban, was due to meet minority leaders during the visit.
His government launched intergovernmental consultations with Kyiv on the minority's status after taking office in May. In October, Ukraine's parliament passed a law giving Hungarian speakers and other minorities who use EU languages wider scope to use their languages in education.
(jh)
Source: PAP