The judgement came after an investigation was launched into Mr Sharif’s family wealth following the 2015 Panama Papers dump linking his children to offshore companies.
Mr Sharif has denied all the allegations throughout the legal process.
The ruling was given unanimously by a five-member bench in the court.
A spokesman for Mr Sharif’s office said in a statement: “Following the verdict, Nawaz Sharif has resigned from his responsibilities as prime minister.”
The court was packed to capacity today, and there was increased security across Islamabad with thousands of extra soldiers and police deployed.
Reuters news agency reports that one of the judges at the Supreme Court, Ejaz Afzal Khan, said that Mr Sharif was no longer “eligible to be an honest member of the parliament.”
Subscribe to our newsletter and stay updated on the latest news and updates from around the Muslim world!
Pakistan’s Interior Minister Chaudhry Nisar Ali Khan advised Mr Sharif to accept today’s judgement.
The Supreme Court has recommended anti-corruption cases against numerous individuals, including Mr Sharif, his daughter Maryam and her husband Safdar, Finance Minister Ishaq Dar amongst others.
Mr Sharif served as prime minister from November 1990 to July 1993, and from February 1997 until he was toppled in a military coup in October 1999.
Allegations of corruption have haunted Mr Sharif since the 1980s, and most of what the Panama Papers exposed was the subject of a federal inquiry in the 1990s.
It is not clear who will succeed Mr Sharif, but his brother Shehbaz, who is chief minister of Punjab province, is seen believed to be a strong candidate for the position.
The court has instructed the National Accountability Bureau (NAB) to put together, and send four references to accountability courts against Mr Sharif and others before the proposed anti-corruption investigations.
NAB has been directed to file these references within six weeks.
The accountability courts have been told to complete hearings in these cases in six months.
The leaks in April 2016 revealed that three of Mr Sharif’s children owned offshore companies and assets not shown on his family’s wealth statement.
The companies were allegedly used to channel funds to acquire foreign assets, including some apartments along Park Lane in London’s prestigious Mayfair area.