The invitation from Kerry, who arrived here last night, will help revive Pakistan-US talks that have been hit by a string of crises since early 2011.
"I have extended on behalf of the President of the United States an invitation to Prime Minister Sharif to meet with the President at a bilateral meeting in the United States this fall," Kerry told reporters.
The two sides share a long-term vision of their ties and Sharif is "someone who's committed to try to grow that relationship," Kerry said.
Sharif described Kerry as a "wonderful friend". He said: "I am very happy that he is the Secretary of State of the United States of America today and I hope to have very good discussions and talks with him."
More From This Section
"I also want to applaud the people of Pakistan for the remarkable, historic transition that has taken place here in Pakistan...The march towards democracy in Pakistan is something to be celebrated," he said.
Bilateral ties were hit when CIA contractor Raymond Davis shot and killed two Pakistani men in Lahore in January 2011. They plunged to a low after Al Qaeda chief Osama bin Laden was killed by US commandos during a military raid in the garrison town of Abbottabad in May 2011.
Since coming to power in the general election held in May, Sharif has made economic growth and resolving an energy crisis the top priorities of his government.
However, Kerry said Pakistan's prosperity depends on doing more to eliminate militants. "Pakistan cannot realise its full economic potential until it overcomes extremists," he told a news conference.
"The choice for Pakistanis is clear: will the forces of violent extremism be allowed to grow more dominant, eventually overpowering the moderate majority?" he said.