Media playback is unsupported on your device Media caption Coups, conflict and cricketers: Pakistan's vital election - in 90 seconds

Unrest in Pakistan's biggest city Karachi has marred landmark national and provincial polls.

Pakistan's election commission said it had been unable to carry out "free and fair" polls in Karachi and that voting would be re-run in some areas.

In the worst election-day violence, 11 people were killed in the bombing of a political office in the city.

The vote marks Pakistan's first transition from one civilian government to another in its 66-year history.

Voting was extended for an hour across the country before closing at 18:00 (13:00 GMT). Counting has now begun in some areas.

But polls are expected to remain open for three hours in seven constituencies in Karachi where voting was delayed because ballot boxes and papers had not arrived on time.

Analysis If this was a contest between defiance and danger, defiance won. Despite worrying threats of violence and intimidation, millions of Pakistanis simply wanted to be counted on this historic day. It was humbling to see old men and women, unable to walk on their own, bent over, and bent on casting a ballot. It was encouraging to see so many young Pakistanis queuing for hours in blazing heat to vote for the first time. It wasn't a perfect election. No-one expected that. There were Taliban attacks, but more gunfights linked to long-standing political rivalries in volatile cities like Karachi. In all four provinces there were isolated gun battles or bomb blasts. And, in some places, there were huge irregularities, and heated accusations of rigging. Many doubted elections would be held at all. Many armed groups wanted to stop them. But the force for change turned out to be greater. Now the results will show what kind of change Pakistan wants..

"At my polling station, the gates have remained closed all day. We have not been able to vote and the crowd outside is huge," Karachi resident Nishat Aleem Khan told the BBC.

Pakistan's election commission said it was "investigating reports of threats made to election officials" and that there would be "no compromise" on the fairness of the poll.

It ordered a halt to voting in 42 stations in Karachi's NA-250 constituency and said the poll there would have to be re-run.

Turnout is believed to have been high. An election commission spokesman said they hoped for a figure of 60-80%.

The turnout in 2008 was 44%.

Karachi violence

The Pakistani Taliban have threatened to carry out suicide attacks.

About two hours after polling started, a bomb attack was reported in Karachi, apparently targeting an Awami National Party (ANP) candidate outside the party's political office.

Eleven people were killed and more than 40 others were wounded, police told BBC News. Local ANP candidate Amanullah Mahsud was injured but not seriously.

The attack happened in the Landhi district of Karachi, which known for Taliban activity. Another ANP candidate and his son were shot dead close to the area last week.

Sporadic violence linked to the election was reported in several other areas of the country.

Seven people were hurt outside a polling station in the north-western city of Peshawar when a bomb went off attached to a motorcycle

A suicide bomber blew himself up after police prevented him from entering another polling station in Peshawar, police told AFP

A clash between two groups at a polling station in Chaman on the border with Afghanistan left least three people dead and several others hurt

An explosion was also reported in Quetta in the south-west

At least four people were hurt in a blast in Mardan in the north-west

Image caption Counting is now underway in some districts

The Taliban have been blamed for numerous attacks throughout the campaign on Pakistan's three most prominent liberal parties.

The Pakistan People's Party (PPP) along with the Karachi-based Muttahida Quami Movement (MQM) and the ANP have been singled out for threats, and were forced to curtail their campaigning as a result.

Militants have so far avoided targeting the campaigns of Pakistan Muslim League-Nawaz (PML-N) of Nawaz Sharif and the Tehreek-e-Insaf (Movement for Justice) party of Imran Khan, who is recovering in hospital after a fall at a party rally.

Pakistan's election commission said in a press conference that two ballot boxes had been stolen in Punjab and that they could be "accounted for".

Whichever party ends up winning the election, it has been a bad day for the Taliban, the BBC's Owen Bennett Jones reports from Lahore.

The Taliban had threatened a bombing campaign to disrupt the electoral process but tens of millions of Pakistanis defied the jihadis and cast their ballots in a good-natured and at times joyous atmosphere, he adds.

'We want change'

Tens of thousands of troops had been deployed at polling stations to ensure security.

In the run-up to the election, more than 100 people died in election-related violence. Before polls opened, Pakistan sealed its borders with Iran and Afghanistan in an effort to keep foreign militants at bay.

11 May elections Polls opened at 08:00 local time (03:00 GMT) and closed at 17:00

86,189,802 registered voters

5,000 are standing for 342-seat National Assembly, 272 are directly elected.

11,692 Provincial Assembly candidates

51 candidates are vying for the NA-48 constituency seat in Islamabad

More than 600,000 security and army personnel will be deployed to guard against possible attacks

More than 73,000 polling stations - 20,000 of which are deemed a security risk

Polls will mark the first time that a civilian government has completed a full five-year term and handed over to an elected successor Politicians and parties Bid to end ballot box fraud Economy confronts Pakistan's leaders

Officials said the borders would remain closed for the next three days.

Queues started forming before polling stations opened at 08:00 (03:00 GMT) on Saturday.

Abdul Sattar, 74, said: "We want change, we are really fed up with old faces coming back to power every time and doing nothing for the nation."

While the streets of Islamabad were largely deserted, areas around polling stations were described as filled with crowds.

At a polling station on the outskirts of the capital, BBC World Affairs correspondent Mike Wooldridge said around 1,000 of the 4,000 registered voters had cast their ballots by midday, including a large proportion of women.

The BBC's Saba Eitizaz in Peshawar reported long queues of women, with many first-time voters.

Right-wing religious party Jamaat-e-Islami complained that some of its voters had been harassed and announced it was boycotting the vote in Karachi and areas of Hyderabad, reports said.

Mr Sharif, who was deposed as prime minister in a military coup 14 years ago, is seen as favourite to return for a third term of office.

As he voted in Lahore, the former PM said he was hopeful of victory.