Itar-Tass news agency said Mr Gorbachev would be confined to Russian territory until he appears before the Constitutional Court, on orders from Russia's Foreign and Security ministries.
Mr Gorbachev, who vacated the Kremlin last December to make way for President Boris Yeltsin, returned last week from a trip to Germany and, according to Tass, was planning another trip abroad.
He has repeatedly refused to testify against the party he led to oblivion, dismissing the hearings as a 'comedy'.
The court, Russia's highest, is examining the party's misdeeds to decide whether President Yeltsin's decision to ban it was illegal, as claimed by Communist parliamentary deputies who initiated the hearings.
On Thursday, the court told Mr Gorbachev to stop 'dodging the law' and warned that it would take 'all constitutional and legal means' to make him appear. The threat was not idle. According to Tass, Mr Gorbachev will be prevented from going abroad 'until he fulfils his civic duty envisaged by the Russian constitution'.
Several leading members of the disbanded politburo have already testified in the long-running hearings, including the former Soviet prime minister, Nikolai Ryzhkov, who insisted the party would one day rise again.
Mr Gorbachev, however, has been categorical in his refusal. 'I cannot be the hero of this comedy,' he said on Tuesday after his return from Germany. He said the trial was a farce aimed at diverting public attention from the government's economic failings.
If he were to appear, Mr Gorbachev would risk severe embarrassment. Lawyers defending the ban on the party have already presented documents which they say implicate Mr Gorbachev in international terrorism and other murky episodes.
President Yeltsin banned the party after an abortive coup by hardline Communist officials in August last year. When he took over from Mr Gorbachev last December, the two men initially agreed to a truce in their long-running political battle.
The order to keep him in Russia comes only two days after Mr Gorbachev unleashed his fiercest attack so far on the government's economic policies.
Dismissing a privatisation drive launched on Thursday as a 'sham', he said that Mr Yeltsin was ruining the country with his programme of radical free-market reform.
Mr Gorbachev also refused to rule out the possibility of one day forming a political party of his own. But he said such a step was not yet necessary and that he would give Mr Yeltsin more time to mend his ways.
However, it seems unlikely that he would attract much popular support. Though still feted abroad as the prophet of perestroika, he is widely disliked in his own country.
According to a poll published this week by Moskovskaya Pravda newspaper, 80 per cent of Russians believe that life was better before Mr Gorbachev took over as general secretary in April 1985 and began his reform drive.Reuse content