Sudan's main opposition leader Sadiq al-Mahdi has called on President Omar al-Bashir to step down, throwing his support behind anti-government demonstrators that started nearly five weeks ago.

"This regime has to go immediately," al-Mahdi, 83, told hundreds of worshippers at a mosque in Omdurman on Friday, the twin city of the capital Khartoum, which has seen near-daily anti-government protests.

Al-Mahdi said since protests erupted on December 19 "more than 50 people" had been killed in the crackdown.

Officials say 30 people have died in the protests, however, rights groups have put the death toll at more than 40.

The protests - which initially erupted in the northeastern town of Atbara and have spread to several cities - initially erupted over the rising costs of bread and fuel and other economic hardships, including skyrocketing inflation and limits on bank withdrawals.

But they quickly morphed into calls for al-Bashir, who has been in power for 29 years, to step aside.

Authorities have used tear gas, rubber bullets and live ammunition to quell the unrest and imposed emergency laws and night-time curfews in some cities.

"A period of transition will come soon... we are supporting this [protest] movement," said al-Mahdi, who served two terms as Sudan's prime minister before being deposed in the 1989 coup led by al-Bashir.

The EX Sudanese Prime minister, Sadiq Elmahdi call Bashir to step down#SudanUprising — خالد عويس (@khalidewais) January 25, 2019

'Document for change and freedom'

After nearly a year in exile, al-Mahdi returned to Sudan last month on the same day protests began.

He added on Friday that his party had signed a document with the Sudanese Professionals' Association (SPA), an umbrella group of unions representing doctors, teachers and engineers that is leading the campaign against al-Bashir's government.

"This is a document for change and freedom," he said.

"Together we will hold peaceful demonstrations in Sudan and outside of Sudan," he said as he condemned the violence and use of "live ammunition" against protesters.

A fixture of Sudanese politics since the 1960s, al-Mahdi was prime minister from 1966 to 1967 and again from 1986 to 1989, before being toppled by Bashir.

Sudan's economy has struggled to recover in recent years following the loss of between 75 and 80 percent of its oil reserves - its main source of foreign currency - with the secession of South Sudan in 2011.

The country's economic woes have been exacerbated in the past few years, even as the United States lifted 20-year-old trade sanctions on Sudan in October 2017.

Washington has, however, kept Sudan on its list of state sponsors of terrorism, which prevents Khartoum from accessing much-needed financial aid from institutions such as the International Monetary Fund and the World Bank.