Thirty-one Omanis convicted in May of trying to overthrow the government have been pardoned.
Sultan Qaboos was apparently the plotters' target
Sultan Qaboos, the country's absolute ruler, issued the order to release the 31, some of them university academics, civil servant and Islamic scholars.
They had been found guilty of setting up an illegal organisation, raising funds and recruiting members.
Six had been jailed for 20 years, while the remainder had received sentences ranging from one to 10 years.
The aim of the plot, state prosecutors had argued, was to overthrow the government of Sultan Qaboos and to establish an Islamic state.
Lawyers for the defendants had maintained that they were innocent and had only been trying to spread the teachings of the Ibadi conservative stream of Islam, which is followed by most Omanis.
The men would be released within hours of the news of their pardon, officials said.
Relatives of some detainees said the authorities had asked them to go to Ramees prison in the capital, Muscat, to take home their loved ones.
The 31 accused were among nearly 100 suspected Islamists arrested across Oman earlier this year.
They were alleged to have been plotting a series of attacks on a popular shopping and cultural festival in Muscat.
Officials said many of those arrested were released.
The arrests and trials of the defendants have been shrouded in secrecy. Officials were slow to acknowledge the action and only a few Omani journalists were permitted inside the courtroom.
Unlike neighbouring Saudi Arabia, Oman has not witnessed any terror attacks and had not been regarded as a potential target of Islamist violence.
In 1994, the Omani authorities announced the arrest of 200 alleged Islamists, who were convicted of belonging to a secret, violent group and given sentences ranging from the death penalty to jail terms. They were later pardoned.