Former Pakistani PM Nawaz Sharif is celebrating with his supporters, amid early signs that his party will be the largest after parliamentary elections.
Media projections based on partial results suggest a big lead for Mr Sharif’s Muslim League, and he has already claimed victory.
The election should lead to the country’s first transition from one elected government to another.
The turnout was huge but the poll was marred by violence.
In Karachi, the Pakistan Taliban said they planted a bomb which killed 11 people and wounded 40 others.
The bomb was placed outside the office of the Awami National Party.
There were also attacks in Balochistan and the north-western city of Peshawar.
Voting was extended for an hour across the country before closing at 18:00 (13:00 GMT).
‘Thank Allah’
An election commission spokesman said they hoped for a turnout of 60-80%. In 2008 it was 44%.
No official results have yet been released, but unofficial partial results suggested that Mr Sharif’s party was ahead in more than 100 of the 272 directly elected parliamentary seats.
It is not clear if they will be able to win a simple majority in the National Assembly.
In a speech at his party headquarters in the north-eastern city of Lahore, Mr Sharif said that the Muslim League (PML-N) was sure to emerge as the largest party.
“We should thank Allah that he has given PML-N [Muslim League] another chance to serve you and Pakistan.”
“I appeal for all parties to come to the table and sit with me and solve the country’s problems.”
However, the BBC’s Owen Bennett Jones in the city says that the mood in the party was not one of joy, as there are so many daunting challenges facing the country.
Mr Sharif’s apparent victory is largely confined to his native Punjab province, which has nearly 60% of the country’s population, and so he will be compelled to look for support from the three smaller provinces for greater legitimacy.
But our correspondent says that even if he had got as few as 90 seats he would still have been able to put together a coalition.
The Movement of Justice (PTI) party of former cricketer Imran Khan has also performed well, with projections saying he had won a big victory in Peshawar.
President Asif Ali Zardari’s Pakistan People’s Party (PPP) is in a race for second place with the PTI, but both seem likely to win fewer than than 40 seats.
Outgoing Prime Minister Raja Pervez Ashraf suffered a crushing defeat in his own seat in Rawalpindi.
The PPP hardly tried – because of Taliban threats against it but also because of a lack of will as it was so unpopular – our correspondent adds.
Borders closed
The Pakistani Taliban threatened to carry out suicide attacks ahead of the election.
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 is known for Taliban activity. Another ANP candidate and his son were shot dead close to the area last week.
The Taliban have been blamed for numerous attacks throughout the campaign on Pakistan’s three most prominent liberal parties.
The 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.
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. Officials said the borders would remain closed for the next three days.
BBC