Khartoum - Sudanese authorities released opposition leader Sadiq al-Mahdi on Sunday, Sudan's State Minister of Information Yasser Youssef told Reuters.
Al-Mahdi, who was arrested in mid-May, was accused of undermining the constitution, a charge that could have led to the death penalty, after he said the government had committed violence against civilians in the Darfur region.
Youssef said the release of al-Mahdi occurred within a "legal framework" but did not give further details.
Al-Mahdi, a former prime minister in Sudan's last elected civilian government, is the head of the Umma Party, the most prominent party opposing President Omar Hassan al-Bashir, who ousted him in 1989.
His daughter Rabah confirmed the news of her father's release.
Al-Mahdi's arrest prompted weekly protests by his supporters. The Umma Party cancelled national dialogue talks called by Bashir earlier this year that were meant to ease political tensions - especially over the handling of Darfur - ahead of parliamentary and presidential polls due next year.
Sudan earlier this month arrested the head of the Congress Party, another opposition group, after he too criticised violent practices by security forces in Darfur.
Bashir has been working to shore up his power in the face of an economic crisis since South Sudan seceded in 2011, taking with it three-quarters of the once unified nation's oil output.
He has remained in office for 25 years despite sporadic rebellions, US trade sanctions, an attempted coup and an indictment from the International Criminal Court on charges of masterminding genocide and other war crimes in Darfur.