Cricket star Imran Khan has declared victory in Pakistan's general elections, but his win is being overshadowed by allegations of election rigging. Opposition parties slammed the outcome, but a European Union monitoring team said despite problems, "over all the election results are credible."

Complaints also emerged from the independent Human Rights Commission, which issued a statement saying that in some places women were not allowed to vote.

In other areas, the commission said, "polling staff appeared to be biased toward a certain party," without naming the party. In the days before Wednesday's election, leading rights activist I.A. Rehman called the campaign "the dirtiest" in his country's troubled journey toward sustained democracy.

Analysts have expressed concern that disgruntled losers could create instability for the incoming new government, which will face mounting challenges - including a crumbling economy, a crippling debt and a raging militancy.

Get Breaking News Delivered to Your Inbox

"Pakistan is a country where the military calls the shots," Willis Sparks, writer for GZERO Media, told CBSN. "They call the shots on foreign and security policy, and even when you try to get into the issues Imran Khan says he wants to deal with, like poverty, like corruption, you're not going to deal with those issues unless you deal with the military."

Sparks says Khan also needs to figure out how to balance relationships with the U.S. and China, which has lent Pakistan money.

"The military wants money. The military needs money and China has provided money and Trump has largely cut them off. So I think that the pragmatic elements of the military leadership are going to say we need to do what we can to have positive relationships with both and you've heard Mr. Khan saying that as well," Sparks said.

Pakistan's election has been marred by recent violence. Ahead of voting, more than 170 people, including three candidates, were killed in suicide bombings in the southwestern Baluchistan and northwestern Khyber Pakhtunkhwa provinces.

European Union's monitoring team gave a failing grade to the pre-polling campaigning marred by intimidation of the media and unfair targeting of the former ruling party.