Tens of thousands of Islamists rallied alongside opposition supporters in Pakistan's capital Friday, as the firebrand cleric leading the protests called on Prime Minister Imran Khan's government to step down within 48 hours.

The so-called "Freedom March" is being led by Khan's long-time rival Maulana Fazlur Rehman, who heads one of the country's largest Islamist parties, the Jamiat Ulema-e-Islam (JUI-F).

As the first day of demonstrations stretched into the night Rehman focused his ire on the country's powerful military, which he and other opposition figures have accused of helping the former cricket star win last year's election.

"They have not come to power on the public's mandate but on someone else's direction... they won't work for the public rather they will only please their selectors," Rehman told his supporters from a makeshift stage, referring to the military.

The first day of the protest remained peaceful even as some in the crowd called for moving the rally closer to parliament, just hours after several marches from across Pakistan converged on Islamabad.

"This is a peaceful rally and we are peaceful people, therefore we want to stay peaceful otherwise this (crowd) has the strength to go to the prime minister's office and arrest him," said Rehman.

"You have two days to resign," he added.

- Heavy security -

Earlier in the day security forces blocked the main entry points to the city with shipping containers but protesters streamed into the capital, with more than 20,000 gathering for Friday prayers, according to an AFP reporter.

Protesters waved black-and-white striped JUI-F flags and chanted slogans as a series of opposition figures and Islamist leaders spoke ahead of Rehman's address.

"The time has arrived for us to get rid of this illegitimate government," Shehbaz Sharif, leader of the Pakistan Muslim League-Nawaz party, told protesters.

"After one year in power, 220 millions Pakistanis are screaming but the time has arrived for Imran Khan to scream."

Story continues

The protest represents the first major challenge to Khan's administration as it struggles to quell simmering public anger over a faltering economy and double-digit inflation.

"We are protesting to send these incapable rulers home... our people are unemployed and factories are shutting down," protester Abu Saeed Khan, who travelled to the capital from the northwestern city of Peshawar, told AFP.

"We have to remove them from power," added Anas Khan, another demonstrator.

The demonstrators have remained vague about what tactics they plan to use during the protest or just how long they will stay in Islamabad.

Rehman, an influential cleric, insists that Khan must be removed from office and a new "free and fair" election held.

The scene on Friday was reminiscent of similar protests that Khan led as an opposition leader in 2014 when his party held months-long mass demonstrations in Islamabad in a failed bid to bring down the government.

As protesters massed in the capital, Khan slammed Rehman during a televised speech in the northern city of Gilgit, vowing to prosecute the cleric for alleged corruption.

"Those who make money in the name of Islam have been exposed," Khan told a thousands-strong crowd of cheering supporters. "I have promised to Allah I will send all those to jail who looted the country."

Ahead of the protests, social media users panned Rehman and his hardline followers over their refusal to allow women to participate, while there were scattered reports that female journalists were prevented from covering the demonstration.

"While giving the intro a man came and started saying women arent allowed, women CANNOT be here. Leave! Slowly but in a minute's time a crowd of men encircled us and started chanting the slogans, we had to leave," tweeted journalist Shiffa Z. Yousafzai.