A terrorist bomb exploded inside a crowded convention center here tonight, injuring at least 18 persons, including seven Americans. But the blast narrowly missed President Ferdinand Marcos, the U.S. ambassador and other high officials seated nearby.

The explosion, witnessed by millions on live national television, was set off minutes after Marcos extended an enthusiastic welcome to about 5,300 delegates attending the opening session of the American Society of Travel Agents.

Security guards immediately leaped to surround the president, U.S. Ambassador Richard Murphy, Phillippine Tourism Minister, Jose Aspiras and other officials seated in the front row about 50 feet from the spot where the bomb was planted, apparently in an attache case placed under an empty seat.

An anti-Marcos group known as the April 6 Liberation Movement had warned the New York-based organization against holding its convention in Manila. Following the explosion, which also touched off a fire, the French news agency Agence France-Presse received a telephone call from the urban guerrilla group claiming responsibility for the bombing.

It was the latest in a series of terrorist incidents that have killed one American and wounded 40 other persons in Manila since Aug. 22. The April 6 group, which derives its name from a mass demonstration held here before the 1978 parliamentary elections, has claimed responsibility for all the previous bombings.

Heeding the terrorist warnings, the Phillippine government had imposed stringent security precautions. A confident Marcos told the convention minutes before the blast that "by your coming here you certainly do away with all these speculations and rumors by men whose only dream is to take over power and political authority. Let them dream. They live in a world of fantasy. Let us live in our world of reality."

[Convention officials decided Monday morning to cancel all public functions and to hold working sessions behind closed doors because of the bombing, a major embarrassment for Marcos in his eight years of martial law rule, United Press International reported.]

According to Aspiras, 18 persons suffered superficial wounds. Other unofficial counts listed as many as 20 injured.

Unofficial sources identified the seven injured Americans as Frederick and Betty Cooper of Aiken, S.C. June C. Breen, who was described as an employe of George Washington University Roberta Fischer of Arlington Heights, Ill. Clifford and Lola Archer of Glendale, Calif., and Joseph Hofrichter of Loveland, Ohio. An official said they suffered mainly from cuts.

Other persons reportedly injured included Don Graham, a Jamaican living in New York.

A spokesman for Marcos said that the president had called on a suspected terrorist immediately after leaving the convention hall tonight. The suspect, an American citizen born in the Philippines, has been held under maximum security at a hospital here following injuries he suffered in a Sept. 4 explosion in his hotel room. He was said to have agreed to turn state's witness.

The spokesman said all persons implicated by the suspect, who was believed to have been assembling a bomb at the time of the Sept. 4 explosion, would be arrested shortly.

Tonight's blast came during an audio-visual presentation of the battle of Manila Bay, in which the Americans defeated Spain at the turn of the century when the Philippines became a U.S. colony. As the guns were pounding the Spanish ships, a loud explosion shook the plenary hall of the Philippine International Convention Center.

"I thought it was part of the audiovisual presentation," said Heinz Patzak, director of the Austrian National Tourist Office in New York. "I saw two men thrown off their seats. Then I saw flames shooting up and blood all over. Then I realized it was for real."

Since the proceedings were covered live on television, home viewers heard the explosion. The station immediately cut the transmission.

Security guards quickly whisked President Marcos through the side exit, as fire engines and ambulances raced towards the convention center.

According to Patzak, "there was no panic, everybody was calm and disciplined and we all trooped out immediately."

The bomb, according to military officers, was contained in one of the briefcases given each delegate. It was placed under an empty seat on the ninth row from the back of the hall. The seat was not occupied, apparently because delegates thought it was reserved.

Cooper, 64, a travel agent, suffered a cut at the back of his head while his wife, Betty, 61, suffered cuts on her face and right leg. Cooper said he and his wife will return home as soon as possible "as my wife is in no condition to continue."

The urban guerrillas, opponents of martial law here as well as U.S.-based exiles demanding that Marcos step down, had launched an advertising blitz in some newspapers in the United States, warning delegates not to go to the Philippines.