"All of them have been released," said Ghazi Salah el-Din Atabani, Sudan's minister of information. "The hijackers will be tried according to international laws."
There were no immediate reports of serious injury among the hostages.
The end of the hijacking came hours after government officials began negotiating with the hijackers, who included five men and one woman. Earlier reports said there were nine attackers.
A few hours after the plane landed in Khartoum, the hijackers released 11 women and children.
Sudan's minister of information, Ghazi Salah el-Din Atabani, had told reporters that the hijackers were seeking political asylum, but did not elaborate.
The television report said the hijackers, students at Ethiopia's Addis Ababa University, demanded meetings with U.S. and British diplomats. It wasn't immediately known if that had occurred.
The United States is represented in Sudan by charge d'affaires Glenn Warren, but it was not clear if he was in the country. And a British diplomat, speaking on condition of anonymity, said that he wasn't aware of any call for involvement by his country.
Sudan's Foreign Minister Mustafa Osman Ismail told Qatar's Al-Jazeera satellite television that the hijackers landed in Khartoum because they were running out of fuel, adding he did not know what their intended destination was.
Ismail said the situation on board had been "extremely bad."
The Antonov 12 aircraft originated in the Ethiopian capital, Addis Ababa, and was heading to northern Ethiopia when the hijackers seized the plane, the TV report said. It landed at Khartoum airport at 6:20 p.m. local time (12:20 p.m. ET) it said.
A crew member who managed to escape out the back of the plane said the hijackers were armed with hand grenades and pistols, the TV report said.
It was not clear which carrier owned the flight. An Ethiopian Airlines official said he had no information about a hijacking.
Authorities barred journalists from the airport, allowing only state television to enter.
The United States withdrew its ambassador to Sudan in 1997, saying the government supports terrorism and has an appalling human rights record. For security reasons, diplomats rotate in and out of the embassy, which operates with a staff of three.
The hijacking follows clashes last week in Addis Ababa between university students and police the worst violence in the Ethiopian capital since 1993.
At least 41 people were killed in fighting sparked by weeklong protests by students demanding greater academic freedom.
On Thursday, Ethiopian officials began releasing hundreds of students arrested during the riots. Students so far have refused to return to Addis Ababa Univerity, where authorities were requiring them to sign statement accepting a ban on demonstrations.
Student unrest in the 1960s and 1970s preceded upheavals that forced Ethiopia's last emperor, Haile Selassie, to institute reforms and ultimately led to his ouster in 1974. Students were also influential in organizing resistance to the military regime that ruled Ethiopia from 1974 to 1991.
Sudan has also been home to unrest. Civil war between Sudan's Islamic government and Christian and animists forces in the country's south has raged for almost two decades, claiming 1.5 million lives, according to the CIA.
The United States bombed a pharmaceutical factory in Sudan in 1998 because it was allegedly producing nerve gas for Islamic terrorist Osama bin Laden.
Sudan is home to 35 million people and covers an area about a quarter the size of the United States. With 64 million people, Ethiopia is about twice the size of Texas.
© MMI Viacom Internet Services Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press and Reuters Limited and contributed to this report