ISLAMABAD, Pakistan — Pakistan's cricket star-turned-politician Imran Khan was sworn in as prime minister on Saturday despite protests by opposition parties, which accuse the security services of intervening on his behalf in last month's elections.

Khan' s Tehreek-e-Insaf party won the most seats in the July 25 national elections but fell short of an outright majority. It allied with independents to form a coalition, and Khan was elected by the National Assembly on Friday. Khan had campaigned on promises to combat Pakistan's endemic corruption and break powerful landowners' monopoly on political power.

Opposition parties have held regular protests since last month's election, alleging vote rigging by the powerful security establishment. Security officials have rejected the allegations, and Khan has vowed to investigate the charges of voting fraud, saying neither he nor his party was involved in any wrongdoing.

"We have not committed any rigging," he told lawmakers in a speech after being sworn in.

Khan secured 176 votes in the assembly on Friday, defeating the opposition's candidate, Shahbaz Sharif of the Pakistan Muslim League, who got 96 votes. Sharif and his party's lawmakers disrupted Khan's speech by chanting slogans against him. Khan responded by saying no one could blackmail him through such protests.

Khan has promised "ruthless accountability" to combat corruption, and has said he will move to a small house in Islamabad rather than live in the lavish prime minister's residence.

Khan acquired a reputation as a playboy during his cricketing years but embraced conservative Islam after entering politics.

His first wife was the wealthy British heiress Jemima Goldsmith, whom he married in 1996. Their two sons live with Goldsmith. He married his second wife, British journalist Rehman Khan, in 2015, but they divorced within a year. Earlier this year, he married his spiritual adviser, Bushra Maneka, who attended Saturday's ceremony when Khan took the oath as premier.

Khan emerged as a critic of the so-called War on Terror after the 9/11 attacks, accusing the United States of fueling extremism by carrying out drone strikes in Pakistan that killed civilians. He has also expressed support for a controversial law that makes blasphemy against Islam punishable by death.

His critics in Pakistan have branded him "Taliban Khan," accusing him of sympathizing with extremists.

Khan has denied those charges, and struck a more moderate tone in this year's campaign, saying he was committed to defeating Islamic extremists and cultivating good relations with the U.S., which for years has demanded that Pakistan do more to combat militancy.

Khan has expressed support for a peace process in neighboring Afghanistan that would end 17 years of war between the U.S.-backed government and the Taliban.