Pakistan's new prime minister has called for an investigation into allegations that opposition politician Imran Khan harassed a former female member of his political party.

Shahid Abbasi on Friday backed moves to form a parliamentary committee to investigate the matter after a group of legislators raised the allegations in the house.

The scandal erupted on Tuesday after Ayesha Gulalai, a National Assembly member from the conservative Khyber Pakhtunkhwa province, announced she was quitting Khan's Pakistan Tehreek-e-Insaf (PTI) party, alleging that he had no respect for women and had sent her obscene text messages.

READ MORE: Shahid Khaqan Abbasi elected as interim prime minister

Khan, a former captain of Pakistan's national cricket team, has denied the allegations and accused the ruling Pakistan Muslim League-Nawaz (PML-N) of organising a smear campaign in the run-up to elections next year.

Gulalai announced in Islamabad that "Imran Khan's list of sins is very long" and that she decided to speak out because she does not want to compromise her integrity.

Gulalai has not released any of the alleged text messages.

Social media storm

Abbasi told the National Assembly on Friday that he wanted a special panel to investigate the allegations.

"We respect the person who has made the accusation, but we also respect the accused, and it is their right to be able to contest these allegations," he said.

The accusations came just days after Pakistan's Supreme Court disqualified the PML-N's Nawaz Sharif, Khan's long-time political rival, for lying on a wealth declaration.

Khan held a rally of his supporters last weekend in the capital, Islamabad, to celebrate Sharif's removal as prime minister.

The scandal has stirred a social-media storm and prompted a debate on sexual harassment in Pakistan.

The backlash targeting Gulalai, in particular, has drawn criticism from women's rights activists, who said the claims should be investigated rather than met with threats of violence.

The Amount of severe hate #AyeshaGulalai has Received from the society shows how Intolerant Pakistan's society is Against women. — Noor (@noorBeeps) August 4, 2017

This isn't about #AyeshaGulalai but the way she's been demonized is EXACTLY why women don't report sexual abuse/harassment. #WhyVictimsStay — Humeira Kazmi (@humeirakazmi) August 4, 2017

I don't know if #AyeshaGulalai was harassed whilst in #PTI but what's happening to her now is definitely harassment. — Amna Zafar (@Amna_ZafarK) August 4, 2017

Meanwhile, supporters of Khan on social media have accused the PML-N of using Gulalai to defame him.

Corruption Mafias PML-N and PPP are trying their best to malign Imran Khan. It won't work. #AyeshaGulalai — Usman (@UsmanSaadat) August 4, 2017

You can tell from her expression that she is fake.....nice timings to make money and secure seat from a rival party #AyeshaGulalai — Usgher (@usgher) August 4, 2017