The Libyan military transport plane had taken off on Friday from the town of Khufrah and was heading for the Eritrean capital Asmara when some of the angry deportees moved into the cockpit.
Reluctant to return to their country, the Eritreans are seeking political asylum in Sudan.
"They are afraid to go home to Eritrea, that's why they said they did it," Sudanese Interior Minister Abd Al-Rahim Muhammad Husayn said.
Human rights groups say hundreds of Eritrean refugees have faced torture and detention after being forcibly sent home.
The Eritrean charge d'affaires said the deportees had no weapons but made such a disturbance on the plane that the pilot decided it was safest to land in Khartoum.
"Some time after take-off they [the Eritreans]attacked us in the cockpit with knives and metal objects. They hijacked the plane and we were forced to land in Khartoum's airport"
One of the pilots
One pilot, however, said the deportees were armed and attacked the aircraft crew.
"Some time after take-off they attacked us in the cockpit with knives and metal objects. They hijacked the plane and we were forced to land in Khartoum's airport," said the pilot.
The plane made an initial landing in Khartoum and the deportees demanded to speak to a UN official. It took off again 40 minutes later when the Eritreans saw heavy security and flew around for 40 minutes before making a second landing.
Michael Lindenbauer, deputy representative in Sudan of the UN High Commissioner for Refugees, said the deportees would spend the night at Khartoum airport.
The Sudanese authorities had made no decision to arrest any of them or force them to go to Eritrea, he said.
Another UNHCR official said the Sudanese authorities were treating the incident as a humanitarian problem.
The deportees had slipped into Libya through Sudan in the hope of emigrating illegally to Europe.