ISLAMABAD (Reuters) - Police on Monday fired tear gas to scatter hundreds of anti-government protesters heading for Islamabad, the Pakistani capital, after a court cleared the way for opposition politician Imran Khan to hold a mass protest this week, media reported.

Television images showed the crowd approaching roadblocks amid clouds of tear gas as night fell near the town of Swabi, about 70 km (44 miles) from Islamabad, on a highway linking the capital to the northwestern city of Peshawar.

Police had set up roadblocks on major roads on Monday morning, particularly those from Khan's political heartland of Khyber Pakhtunkhwa province, ruled by his Pakistan Tehreek-e-Insaf (PTI) party.

Earlier, the Islamabad High Court dismissed government challenges to Wednesday's protests, but ordered Khan to hold the demonstration on a parade ground far from the city's main government and commercial districts, Geo Television reported.

Justice Shaukat Aziz Siddiqui also ordered the government to ensure protection for the fundamental rights of residents of the capital to go about their daily lives, Geo said.

Khan has threatened to "shut down" Islamabad in his push to unseat Prime Minister Nawaz Sharif on grounds of alleged corruption linked to the "Panama Papers" leak.

On Sunday, however, he said his rallying cry to stop the government from functioning was not a direct threat, but rather a prediction of events if his supporters flooded into the city.

The political tension has sparked periodic clashes between PTI supporters and the police, who have arrested scores of opposition workers and used tear gas to disperse protesters defying a citywide ban on public gatherings.

Party lawmaker Arif Alvi and another senior party official, Imran Ismail, were briefly detained on Monday, and bundled into a police van near Khan's home.

On social network Twitter Ismail said he had been "arrested brutally", and posted a selfie picture of the two men smiling on the way to a police station. However, the interior minister swiftly ordered their release.

Last week, the government outlawed gatherings of more than five people in Islamabad and neighboring Rawalpindi. Scores of Khan's partyworkers have been arrested since, the party says.

Khan, a former national cricketing hero, has vowed not to back down unless Sharif resigns, or submits to investigation regarding the "Panama Papers" leaks.

Documents from the Panama-based Mossack Fonseca law firm in April appear to show that Sharif's daughter and two sons owned offshore holding companies registered in the British Virgin Islands. Sharif's family denies wrongdoing.

Holding offshore companies is not illegal in Pakistan, but Khan has implied the money was gained by corruption. Khan admitted in May that he himself used an offshore company to legally avoid paying British tax on a London property sale.

Pakistan's Supreme Court is set to take up a case regarding the allegations on Tuesday.

(Writing by Asad Hashim; Editing by Clarence Fernandez)