The government of Prime Minister Nawaz Sharif was toppled in a military coup Tuesday after weeks of mounting tension between Pakistan's civilian leadership and its powerful armed forces. Army units fanned out across the country to seize control of airports, state television and communication centers.

The move came within hours of Sharif's decision to fire Gen. Pervaiz Musharraf, the head of the armed forces. He had clashed with Sharif over a range of policy issues, most directly over Kashmir, a disputed Himalayan border region where Pakistan fought a 10-week battle with India this year.

The coup, the fourth in Pakistan's 52-year history, ended a string of democratically elected governments that have been in place since 1988. It plunged the key U.S. ally into a period of political uncertainty and threatened to increase tensions with India, Pakistan's longtime rival. The neighbors have both tested nuclear weapons and missiles in the past 18 months.

India expressed deep concern with the government's ouster and put its army on high alert. Indian Prime Minister Atal Bihari Vajpayee held a crisis meeting with advisers Tuesday evening and scheduled another emergency session for today, shortly after he was sworn in for a second term of office.

Sharif and key members of his cabinet were placed under army arrest at an undisclosed location in Islamabad, Pakistan's capital, as troops from the military's elite Special Services Group assumed control of key government installations.

In a two-minute address to the nation broadcast on state television at 3 a.m. today, Musharraf, dressed in his olive green battle fatigues, said the armed forces had intervened to save the country from an economic and political crisis.

"I wish to inform you that the armed forces have moved in as a last resort, to prevent further destabilization," Musharraf said. "The armed forces have been facing incessant public clamor to remedy the fast-declining situation from all sides of the political divide."

Although Musharraf did not make clear who was running the country, he said, "For the moment, I only wish to assure you that the situation in the country is perfectly calm, stable and under control." Soon after toppling Sharif, top aides to Musharraf visited the chief justice of the country's supreme court to consult with him on how to proceed.

Although there were some unconfirmed reports of shots being fired, the ouster of the government appeared to take place without violence. Many Pakistanis cheered the power shift, according to news reports, and state television played nationalistic songs throughout the night and into the morning.

Signs of a possible military coup have been apparent for weeks as differences between Sharif and Musharraf deepened. Three weeks ago, Clinton administration officials, alarmed by the political turmoil, expressed their concern to the Sharif government directly -- an intervention that U.S. officials believed had calmed the situation.

On Tuesday, however, while Musharraf was on an official visit to Sri Lanka, Sharif sought to end the threat to his government by announcing the general's dismissal. Sharif named the country's intelligence chief, Lt. Gen. Khawaja Ziauddin, a close political ally with longstanding ties to Sharif's family, as the new head of the armed forces. But within two hours, military units loyal to Musharraf were on the streets, and he quickly returned to Pakistan.

"We were fully prepared for such an action [by the prime minister] with a contingency plan," said a senior military official, speaking on condition of anonymity. The official accused Sharif of attempting to politicize the armed forces by trying to replace Musharraf with "a party loyalist." Ziauddin was also placed under arrest.

The roots of Sharif's conflict with the military leadership date back to October 1998, when Musharraf, 56, a career military officer and veteran of two wars with India, replaced Gen. Jehangir Karamat as army chief of staff. Karamat had angered Sharif with his criticism of the government's economic and security policies, but Musharraf was no different.

Sharif and Musharraf jostled repeatedly over a number of issues, but it was Kashmir where their differences came to a head.

In July, after more than two months of clashes between Indian and Pakistani forces, Sharif bowed to U.S. pressure during a visit to Washington and called for the withdrawal of military-backed Pakistani guerrillas from the Indian side of Kashmir. The military considered the pullout a humiliating defeat.

The prime minister "had brought disgrace to the Pakistani army by bowing down before the U.S. administration for an abrupt pullout from Kargil," the remote part of Kashmir where the fighting took place, another military official said. "In the aftermath of the Kargil crisis, we went through almost a revolt situation in the army as the rank and file thought that the government had betrayed them."

Military sources said that the army corps commanders were furious that instead of negotiating a settlement, Sharif settled for what one official called a "humiliating" withdrawal of troops. The corps commanders argued that Pakistani troops and Kashmiri militants had trapped the Indian army in the remote, mountainous region, and that Sharif should have used that position as a bargaining chip with the Indian government.

Another irritant between the military and civilian leadership emerged in July, when the Indian air force shot down a Pakistani navy training plane, killing 16 people. Ranking military sources said that Sharif had rejected the military's demand for a tit-for-tat response against India. "This situation fueled the fire further," according to a senior army official.

Military sources said Sharif opened another front with the country's military commanders by reiterating last month his promise that he would consider signing the Comprehensive Test Ban Treaty, which would bar all nuclear tests by signers. The announcement enraged the military leadership, which opposes Pakistan's signing the treaty before India agrees to sign it.

The sources said Sharif also had hinted recently that he was against Pakistan responding to India's missile testing with further missile tests of its own. "He wanted effectively to cap Pakistan's missile and nuclear program and wanted to divert the money to ill-conceived projects such as housing schemes," an army general said Tuesday on condition of anonymity. He was referring to a $2 billion government plan to build housing for impoverished Pakistanis.

Another apparent irritant in the government's relationship with the armed forces was the country's ties to Afghanistan's Taliban militia. Military sources said that Sharif, at U.S. insistence, had agreed to reduce Pakistan's long-standing strategic relationship with the Taliban. That could have upset the military, which has maintained close ties with the Taliban since it emerged from the chaos that followed the guerrilla war against Soviet troops in Afghanistan in the 1980s.

The Making of a Coup

The Pakistani military, which ruled Pakistan for two decades off and on between 1958 and 1988, appeared in recent years to have assumed a more traditional role, at least officially subordinate to civilian control. But in the wake of another crisis over Kashmir, an area claimed by Pakistan and India, Pakistan's military launched another coup against a democratically elected government, the fourth coup in the nation's history.

The Main Players

Military chief of staff since October 1998, he ousted Prime Minister Nawaz Sharif yesterday. He is a veteran of two wars against India. During the most recent clashes over Kashmir last summer, a rift developed between Musharraf and Sharif after the prime minister, giving in to U.S. pressure, ordered Pakistani militants to withdraw from Indian territory. The dispute between the two men began last year over staffing of the intelligence service.

Sharif's 31-month-old government had grown unpopular because of Sharif's heavy hand in muffling dissent and his inability to lift the nation out of poverty. Sharif dismissed Musharraf yesterday, and within hours, soldiers took over government buildings, airports and television stations and arrested the prime minister.

Pakistan's Military

Total armed forces:587,000

Defense budget, 1998:$3.2 billion

* The military has mounted three previous coups, in 1958, 1969 and 1977.

* Pakistan has fought two wars with India over Kashmir, in 1947 and 1965, and another with India in 1971 over the secession of Bangladesh. There have been countless border skirmishes in the disputed Himalayan region, including a 10-week conflict this year.

* Pakistan last year tested several nuclear devices and has developed medium-range missiles, including the Ghauri (930 miles), Haft-3 (500 miles) and M-11 (190 miles)

Pakistan in Profile

Population

1999: 135 million

2025 (projected): 225 million

Age distribution, under age 15: 41%

over age 65: 4%

Life expectancy: 58 years

Religion: Muslim 97%

Living Standard

GNP per person (income): $500

Poverty (income of $1 or less a day): 11.6%

Adult literacy:

25% women

55% men

Economy

Gross national product: $64.6 billion

Growth of GNP 1996 to '97: 0.0%

Total official development aid, 1997 $597 million

Aid per person: $5

Total external debt: $32 billion

Debt service as percent of GNP: 6.5%

SOURCES: World Bank, United Nations, and the Military Balance