INDIANAPOLIS, AUG. 21 -- A high-ranking Cuban official will attend the Pan American Games closing ceremonies after a threat to boycott by Cuba was withdrawn, and the U.S. State Department has agreed to provide a visa, organizers announced today.

Jose Ramon Fernandez Alvarez, Cuba's minister for Education and Sport, will represent Cuban President Fidel Castro's government in the closing cermony Sunday at the Hoosier Dome, said Robert Helmick, president of the U.S. Olympic Committee. The presence of Alvarez is an honorary one signaling that Cuba will host the next Pan Am Games in Havana in 1991.

"In my discussions with the Cuban delegation, they expressed that this would be the appropriate person to be present on the occasion of the Games being transferred to Havana," Helmick said.

Ted Boehm, president of the local organizing committee (PAXI), said officials here received assurances from the State Department yesterday and again today that Alvarez would be permitted into the country. It is usual protocol for high-ranking officials from the future host country to be present as the flag of the current host is lowered, and the new host's raised.

Conrado Martinez Corona, chief of the Cuban delegation, said the Cubans would attend the ceremonies despite the boycott threat, and that Alvarez probably would arrive sometime on Saturday.

"It is a great happiness to hear that a great figure in our government is going to be here," he said through an interpreter. "I think it is going to be a pleasantness for all."

Helmick said the presence of Alvarez could ease the awkward position in which the USOC was placed when the State Department denied a visa for a Chilean athlete who wanted to compete here. According to International Olympic Committee rules, visa considerations should not prevent an athlete from competing, and international organizers had threatened to punish the USOC as a result. Helmick said last week that some Pan American Sports Organization members felt Anchorage's bid to be host for the 1992 Olympic Games should not be considered.

Helmick said the State Department's promise to grant a visa had no connection to the decision to deny a visa for the Chilean, shooter Daniel Zuniga, who is accused of being a member of the secret police. But Helmick also said it will indicate to international sports officials that the Chilean visa was an extreme case and that the State Department is prepared to follow IOC rules on visas.

"This demonstrates that the State Department is prepared to set aside politics in permitting visas," Helmick said.

The presence of Fernandez may erase some problems for the USOC, but it may cause extra ones for the local organizing committee, chiefly in the area of security.