Pedro Joaquin Chamorro, the owner and publisher of Nicaragua's only opposition newspaper and the most prominent critic of the Central American country's military dictatorship, was assassinated by unidentified gunmen in the Nicaraguan capital today.

The shooting occurred as the 53-year-old Chamorro was on his way to the offices of La Prensa, the daily which he had owned and directed since 1952.

Several men reportedly intercepted his car and fired about 20 shots. The publisher died on the way to a hospital.

The government of Gen. Anastasio Somoza denounced the assassination and promised an exhaustive investigation.

Apart from Somoza, the heavy-set and humorous newspaper editor was perhaps Nicaragua's best known politician, both at home and abroad. He dedicated most of his adult life to fighting the Somoza dynasty -- which has ruled this small republic since 1936 -- through his newspaper and through a coalition of opposition groups, The Democratic Liberation Union, which he founded and led.

Chamorro was generally considered the most likely man to succeed Somoza, 51, as president if the strongman were forced to step down. The West Point-educated dictator is currently faced with failing health, a fast-eroding power base and a growing split in the military.

The killing of Chamorro sparked widespread speculations about motives. Here in Mexico City, Donald Castillo, an exiled Nicaraguan professor of economics close to the newspaper editor, said "Chamorro knew he was risking his life. The situation was becoming more and more dangerous because military officers were approaching him and expressing their discontent. Chamorro was obviously becoming more and more important as the end of Somoza seems to becoming near."

In Washington, Rep. Donald Frazer (D-Minn.), chairman of the House subcommittee on international organizations, called the assassination "a great blow to the struggle for human rights both in Nicaragua and throughout the Americas."

There was a consensus among political observers ere that Chamorro's assassination will provide added strains to the already tense situation in Nicarague, where various sections of society have been pressing for Somoza's resignation.

Chamorro, who visited the United States last October, had said he received indications from American officials that Washington was gradually withdrawing support for the Somoza family.

Chamorro's visit was tied to an award he received at Columbia University for his long struggle for press freedom.

Chamorro once defined himself as a social democrat with conservative views. In recent years he became more willing to join forces with leftist political groups, including the Communist Party, to bring Somoza's downfall. He even began to speak favorably of a Marxist guerilla group once its political line changed from fighting for socialism in Nicaragua to fighting for democracy.

Like so many Latin American journalists, Chamorro's career was strewn with periods of political activism, including armed rebellion.

In the 1950s he participated in two abortive invasions against the Somozas, staged from neighboring Costa Rica. He was sent into political exile twice and jailed at least five times.

La Prensa, which he inherited from his father, is one of the few outspoken papers in Central America. Although arrests of its reporters have been routine and the paper has suffered economic boycotts and was shut down several times, Chamorro continued to fight. When censorship became heavy in recent years, Chamorro turned to writing books and short stories.

Four months ago Somoza lifted censorship.

When Chamorro was asked once why he was so bitterly attacked by the left, he replied, "They call me a capitalist but I had to make La Prensa a very strong company to resist the boycotts and closing down. If we hadn't made money we would have disappeared."