The foreign engineers had been seized separately from near their workplaces earlier this month in oil-rich Upper Nile state.
Indians Midhun Ganesh and Edward Ambrose and Pakistani Ayaz Hussein Jamali, who worked for DAR Petroleum, had been seized separately from near their workplaces earlier this month in oil-rich Upper Nile state.
"Following requests from Indian and Pakistani governments, the Sudanese and Ethiopian governments coordinated together to secure the release of the three oil workers," Sudan's National Intelligence and Security Service (NISS) said in a statement.
It did not specify when the hostages were released. The Indians had been abducted on March 8 and the Pakistani on March 19.
Officials said NISS coordinated the release of the hostages.
The three were brought to Khartoum on Thursday in a special aircraft from Ethiopia, an AFP correspondent reported.
"They kidnapped us in order to tell the international community that foreigners should leave South Sudan," Jamali told reporters at the airport.
"The rebels want to shut down all oil processing plants in South Sudan."
The two Indians are from the southern state of Tamil Nadu, while Jamali belongs to Sindh province in Pakistan.
"We were not tortured or ill-treated by our captors," Ganesh, 26, told AFP.
South Sudan, the world's youngest nation formed after splitting from the north in 2011, has been wracked by civil war since December 2013.
The conflict erupted after President Salva Kiir accused his rival and former deputy Riek Machar of plotting a coup.
The violence has left tens of thousands dead and more than three million displaced.
Oil production -- from which South Sudan gained 98 percent of its revenues on its independence five-and-a-half years ago -- has plummeted by more than half and the country is struggling to halt rampant inflation.