Sharif won the Sargodha constituency seat from his stronghold Punjab province and his party was reported to be leading in 110 of the 203 seats for which trends were available.
Polling was held for 272 seats in the National Assembly.
Cricketer-turned-politician Khan won Peshawar-I constituency even as his party led in 32 seats.
"Awami National Party's Ghulam Bilour has admitted defeat from Imran Khan on NA-1 (Peshawar-I). Khan won 66,464 votes from the seat," Express News reported.
Sharif got 19,125 votes, defeating Pakistan Tehreek-e-Insaf's Noor Hayat who only secured 6,065 votes.
Initial trends available for 229 off the 272 seas at stake showed PML-N leading in 110, Pakistan Tehreek-e-Insaf in 32, PPP in 31 while independents lead in 20 and JUI-F in 10.
Meanwhile, violence hit Pakistan's biggest city Karachi immediately after polling ended, killing two security personnel.
SSP Imran Shaukat said the attack appeared to be a suicide attack in which the two rangers personnel had been killed.
Image: PML-N chief Nawaz Sharif waves as he arrives to cast his ballot in Lahore on Saturday
Photograph: Mohsin Raza/Reuters
Pakistanis vote in historic polls, 24 killed in violence
Don't have too many expectations from new Pak govt
Defying Taliban's threat, Pakistan holds landmark polls
Pakistan Polls: The men who MATTER
15 killed, 70 injured in Pak election rally blast