By M Ilyas Khan
BBC News, Islamabad
By deporting former premier Nawaz Sharif to Saudi Arabia hours after he landed in Pakistan, the country's military-led government has made a difficult choice.
Nawaz Sharif waves to supporters during his brief stay in Pakistan
It has opted for a confrontation with the Supreme Court instead of allowing Mr Sharif, an unpredictable rival, to set Pakistan's political agenda ahead of elections due later this year.
But will this choice make life easier for Gen Pervez Musharraf, the embattled president of the country?
The Supreme Court ruled in July that Mr Sharif could return to the country, ending a seven-year-long exile.
His deportation to Saudi Arabia on Monday, say legal experts, breaches that verdict and constitutes contempt of court.
So what was the government thinking when it decided to exercise this option?
Perhaps the answer lies in the choices Gen Musharraf faces during the next couple of months
Eight years after he toppled Mr Sharif's government in a dramatic coup, Gen Musharraf has lost much of his earlier glow.
For more than a year, he has been struggling to contain growing public unrest and an increasingly independent judiciary.
He has been fighting a losing battle against Islamic militants and ethnic Baloch nationalists in the north and west of the country.
Sharif supporters throw stones at police
Last March, by suspending the country's chief justice he inadvertently sparked a countrywide protest movement by lawyers, civil society groups and the opposition parties.
His moral standing suffered a major setback when the Supreme Court, in a popular move, reinstated the chief justice in July.
All these troubles have come just two months before Gen Musharraf's term as president expires.
His term as the army chief technically expired in August 2003 when he reached retirement age, but a special act of parliament allowed him to carry on as both president and army chief until 15 November 2007.
He has been exploring different options to retain both offices for another term, but none of them are likely to stand up in a court of law.
Another parliamentary exemption may help, and it has been offered to him by the PPP, the largest party in the country. But it wants him to give up his army post and settle for reduced presidential powers.
Benazir Bhutto - will she pull out of talks with Gen Musharraf?
Alternatively, he could order his intelligence agencies to try to ensure a parliamentary victory for his PML-Q party loyalists by rigging the elections. But that could backfire, given the increasing influence and confidence of the electronic media in Pakistan.
Given these tough choices, many in the government were afraid that an anti-Musharraf campaign by Mr Sharif would upset the delicate balancing act Gen Musharraf has to perform to survive in office.
When Mr Sharif decided to return to the country, one option was to arrest him in connection with some of the corruption cases still pending against him, and put him in jail.
Gen Musharraf's government risks being ruled in contempt of court
But his continued presence in the country might well have caused the political temperature to rise, especially in the wake of a renewed campaign by the country's lawyers to stop Gen Musharraf from running for another term.
It might also have tempted the PPP to either toughen its demands in its negotiations with the government, or to pull out of the talks altogether, given that PPP leader Benazir Bhutto has been coming in for criticism for trying to reach a deal with the military-led government.
It was therefore imperative, from the point of view of the government, to prevent Mr Sharif from returning and staying on in the country.
And exile in Saudi Arabia was the best option.
In December 2000, Mr Sharif was granted a presidential pardon in two criminal convictions and exiled to Saudi Arabia.
The Pakistani and Saudi governments say that as a quid pro quo, he promised not to return to Pakistan or interfere in its politics for 10 years.
His latest deportation to Saudi Arabia means that he could be out of the picture for another three years.
But observers believe the move itself is fraught with several risks.
For one, the government risks a backlash from the lawyers and the opposition groups who view Mr Sharif's deportation as an illegal move.
The Supreme Court, which owes its newfound freedom to the lawyers' movement for the restoration of the rule of law, will be under pressure to hold the government accountable.
A petition against Mr Sharif's deportation has already been filed by his PML-N party.
If the Supreme Court rules in favour of Mr Sharif it will be another blow to the government's credibility.
It would also make it harder for the PPP to continue to negotiate power sharing with a government that is seen to have openly violated the basic rights of a popular leader.