Pakistan's top judge moved on Friday to allay fears of a possible military coup as tensions rose between the civilian government and the country's powerful generals over a controversial memo alleging an army plot to seize power.

There is no question of a takeover. Gone are the days when people used to get validation for unconstitutional steps from the courts, Supreme Court Chief Justice Iftikhar Chaudhry said on Friday.

The Supreme Court is looking into a petition demanding an inquiry into the matter and Chaudhry's warning came during those proceedings.

Army chief General Ashfaq Kayani has called for an investigation into who may have been behind the memo that could further undermine deeply unpopular President Asif Ali Zardari.

Newspaper editorials highlighted unease in the nuclear-armed South Asian nation, predicting a showdown between Zardari and his allies and the military, which is so influential it has been described as a state within a state.

A spectre is haunting Pakistan -- the spectre of a clash between the army and the government that threatens to turn fatal, said an editorial in the News.

Businessman Mansoor Ijaz, writing in a column in the Financial Times on October 10, said a senior Pakistani diplomat had asked that a memo be delivered to the Pentagon with a plea for U.S. help to stave off a military coup in the days after the raid that killed al Qaeda leader Osama bin Laden in May.

Ijaz later identified the diplomat as Pakistan's ambassador to Washington, Husain Haqqani, who denied involvement but resigned over the controversy.

The military faced unprecedented public criticism over the bin Laden affair, widely seen as a violation of sovereignty.

But many Pakistanis rallied around the army after a November 26 air attack by U.S. forces in Afghanistan mistakenly killed 24 Pakistani soldiers on the border. The memo has also helped boost the army's image at the expense of the government.

What has become known as memogate has made Zardari, who is close to Haqqani, more vulnerable than ever since taking office in 2008 in a country where anti-U.S. feeling runs high.

His government, heavily reliant on foreign financial help, has failed to tackle myriad problems, from crippling power cuts, to suicide bombings and a struggling economy.

The army is fed up with Zardari and wants him out of office, although through legal means and without a repeat of the coups that are a hallmark of the country's 64 years of independence, military sources told Reuters on Thursday.

TEMPERS FLARE

Another military source said tensions must be defused.

Tempers are flaring, there is no doubt about that. However, there are efforts to pacify the situation as well. And I hope they work, as under the current scenario, it is fast becoming a recipe for a head-on collision, he told Reuters on Friday.

Dawn, one of the country's most respected newspapers, said it would be premature to assert that an extra-constitutional removal of the government was in the works, but it noted the army has seized power before.

The breach between the army and the government appears to have widened to dangerous levels, it said.

Friction between Pakistan's civilian government and military have bedevilled the nation for almost its entire existence, with the military ruling for more than half its 64-year history.

Any coup -- Pakistan has had three since independence in 1947 -- could further tarnish the military's image which has already taken a battering after the bin Laden operation, widely seen in Pakistan as a violation of sovereignty.

But the army remains the arbiter of power and analysts say it has plenty of ways to pressure Zardari to step down, especially if a link is established between him and the memo, which sought the Pentagon's help in averting a feared coup.

In the past the army has asked Pakistani civilian leaders to resign and influenced judicial proceedings against them.

The United States wants political stability in Pakistan so that its ally can help fight militancy and aid Western efforts to stabilise Afghanistan.

On Thursday, Prime Minister Yusuf Raza Gilani told parliament that any institution acting as a state within a state was unacceptable, in a clear reference to the military.

He also praised the army in what The Express Tribune described as an attempt by him to assuage the powerful institution, while at the same time clearly saying that whatever is happening will not be taken lying down.

Zardari returned to Pakistan this week from medical treatment in Dubai that raised speculation he would resign under pressure from the military.

Although his position is largely ceremonial, he wields considerable influence as leader of the ruling party and his forced departure would be a humiliation for the civilian leadership and could throw the country into turmoil.

Zardari is the widower of former premier Benazir Bhutto, who spent years opposing military rule before she was assassinated in 2007.

Pakistan's next parliamentary elections are not due until 2013, although some opposition parties have been calling for early polls. Presidents are elected by legislators.

Summing up Pakistan's realities since its creation, the Daily Times said:

No one can disagree with the principle of civilian supremacy but Pakistan's history is witness to how the military holds it in utter contempt and considers itself not to be subservient to the elected representatives.

(Writing by Michael Georgy; Editing by Paul Tait)