Riyadh cut diplomatic relations and closed borders with its neighbour to "protect its national security from the dangers of terrorism and extremism," the official Saudi Press Agency said.
A Saudi official cited by SPA said Riyadh decided to "sever diplomatic and consular ties with Qatar, and to close all land, sea and aviation ports."
The "decisive" measure was due to the "gross violations committed by authorities in Qatar over the past years," the Saudi statement said.
Many expatriate and Saudi travellers use Qatar as their gateway into the kingdom.
A Saudi-led coalition which for more than two years has been fighting Iran-backed rebels in Yemen separately announced Qatar was no longer welcome in the alliance.
In a statement, the coalition accused Qatar of "support to (terrorist) organisations in Yemen".
Qatar had assigned warplanes to the coalition conducting air strikes against Yemen's Huthi rebels.
Egypt's foreign ministry also accused Doha of supporting "terrorism" and announced the closure of its ports and airports to Qatari carriers.
Doha launched a probe into an alleged "hack" of state media after it said false and explosive remarks attributed to Emir Sheikh Tamim bin Hamad Al-Thani were published on the Qatar News Agency website last month.
The stories quoted him questioning US hostility towards Iran, speaking of "tensions" between Doha and Washington, commenting on Hamas and speculating that Trump might not remain in power for long.
The alleged comments were made after Trump's visit to the region.
However, Doha has denied all the comments and said it had been the victim of a "shameful cybercrime".
Trump's visit to Riyadh -- the first foreign stop of his young presidency -- saw the two sides sign a "strategic vision" agreement to intensify ties in defence, economics and other areas.
Riyadh has embraced Trump's harder line against its rival Iran, with which it severed diplomatic relations in January last year.
In a Riyadh speech to Muslim leaders from around the world, Trump urged them to "drive out" extremists and "terrorists", as Sunni jihadists carry out attacks in many countries.
But he also singled out Shiite Iran for allegedly fuelling "the fires of sectarian conflict and terror".
Qatar said it had also been the victim of a hostile media campaign, particularly in the US over the issue of its supposed support for Islamist groups.
Qatar has so far given no indication of where the alleged cyber May 24 cyber attack originated.
But regional powers including Saudi Arabia and the United Arab Emirates used the comments to demonstrate that Qatar is out of line with Gulf foreign policy, especially regarding Iran.
Media organisations in several countries in the region reported the emir's comments as fact, despite an official denial by Qatar.
They also blocked Qatari broadcasters and websites following the alleged comments.
In a sign that the rift in Qatar's relations with its near neighbours was deepening, one Saudi newspaper reported that members of a prominent Saudi family had demanded that Qatar's state mosque, the Sheikh Muhammad Ibn Abdul Wahhab Mosque, be renamed.
The demand came amid questions over the Qatari royal family's link to Abdul Wahhab, co-founder of the Saudi state.
Some experts had feared the current situation could trigger a repeat of the crisis in 2014, when several Gulf countries recalled their ambassadors from Doha, ostensibly over its support for the Muslim Brotherhood.
Last week the Qatari emir travelled to Kuwait to meet Emir Sheikh Sabah al-Ahmad Al-Sabah in what was widely seen as an attempt at mediation by the Kuwaitis.