Central American foreign ministers held critical discussions on easing the threat of regional war here today, bolstered by a conciliatory public gesture from President Fidel Castro of Cuba.

The Cuban leader said on U.S. television networks that he would be willing to go along with an agreement by all countries in the area barring arms shipments from one state to another and requiring withdrawal of all foreign advisers from Central America.

His comments, at a reception in Cuba last night, constituted a highly visible bow in the direction of efforts by the Contadora group of Mexico, Colombia, Panama and Venezuela to arrange a peaceful settlement of Central American conflicts threatening to turn the guerrilla battles of El Salvador and Nicaragua into broader warfare.

In Washington, President Reagan said he feels Castro deserves "the benefit of the doubt" on his proposal. Reagan, in an interview with WRC-TV, added that he felt a new openness to negotiations on Castro's part resulted from the recent U.S. show of strength.

[White House officials pointed out that Reagan was not inviting talks with Castro and said that as a forum for any negotiations he would prefer the Organization of American States to the Contadora Group, which could be more sympathetic to Cuba, reported Washington Post staff writer Juan Williams.]

Castro's statements closely paralleled the major points of an appeal made July 17 at a meeting of the Contadora Group presidents at Cancun, Mexico. In an effort to translate that appeal into concrete steps, the four countries' foreign ministers began a three-day meeting here last night, along with foreign ministers of the Central American countries involved: Nicaragua, El Salvador, Honduras, Guatemala and Costa Rica.

The Cuban leader enunciated the main points of what has been Havana's public stand for some time. But in his comments to the television journalists, Castro formulated it in what seemed to be particularly conciliatory language at a time when Central American leaders have grown increasingly anxious over the threat of spreading conflict.

"If there were to be an agreement among all parties involved about withdrawal of all advisers, we would be willing to support such a settlement," he said. "If agreement were reached on the basis of a cessation of sending weapons to any state of Central America, we would be willing to abide by it."

The Reagan administration repeatedly has complained about what it says are up to 2,000 Cuban military and security advisers in Nicaragua and Cuban arms shipments passing through Nicaragua to the leftist guerrillas in El Salvador. The U.S. government cites these as the chief causes of violence in the region.

It appeared that Castro was going out of his way to seem to respond to the U.S. objections. But as in the past, he also was careful to say that Cuba would go along with such an accord only if all parties--including the United States--would agree to stop sending arms and advisers.

This would mark a major shift in U.S. as well as Cuban policies. President Reagan has defined maintenance of the U.S.-backed government in El Salvador as vital to U.S. security and his administration has sharply increased military aid to Honduras against what it says is a threat from Nicaragua. Similarly, Castro continued to insist that any negotiated agreement would have to include a negotiated settlement of the Salvadoran conflict, rather than the rebel participation in elections that the United States has insisted on.

Responding to U.S. complaints about Cuban military advisers in Nicaragua, Castro put their number at only 200.

"That's what I mean when I say unusual confessions," Castro said. "I mean the United States would not interfere in the internal affairs of Central America and we would commit to the same thing--not to interfere."

A White House spokesman, queried about Castro's televised declarations, noted that Reagan informed the four Contadora presidents in a letter last week that U.S. policy also favored an accord barring advisers and weapons shipments as long as it was verifiable.

Foreign Minister Miguel D'Escoto of Nicaragua told journalists on arrival here last night that the Sandinista government feels it is participating in the discussions "with a pistol placed at our head." This was an allusion to U.S. support for antigovernment guerrillas attacking inside Nicaragua from rear bases in Honduras and Washington's announcement of large-scale naval maneuvers off both Central American coasts to coincide with ground exercises involving up to 4,000 U.S. soldiers in Honduras.

"It is truly difficult, and this goes to show what we have been saying all along: the United States is boycotting, is trampling, is doing everything it can to make the Contadora initiative fail," D'Escoto said.

The Reagan administration has expressed support for the Contadora effort, named for the island off Panama where the four countries began their peacemaking role in January. Some Central American diplomats have suggested, however, that U.S. support is only lukewarm. They say the Reagan administration does not genuinely share the Contadora view that peaceful accommodation with the revolutionary Sandinista leadership in Nicaragua is still possible.

Announcement of the plans for U.S. naval and ground maneuvers next month, coupled with suggestions from U.S. officials that the ships may practice setting up a quarantine around Nicaragua, also heightened the sense of impending conflict that has been building in the region. This gave new urgency to the foreign ministers' gathering here.

"Time is running out," said Foreign Minister Juan Jose Amado Tercero of Panama.

Staff writer Williams added from Washington:

Reagan in the interview at the White House Friday afternoon, said he felt the Cuban leader is now more open to negotiations because of the administration's decision to demonstrate to Cuba and the Soviets that the United States is willing to use military strength to show that "we are not going to back away from what we think must be done there.

"I think that I am willing to give him the benefit of the doubt in any negotiations and so forth," the president said in an hour-long interview with WRC-TV. "But we will take the lead, and we've said from the very beginning, 'Yes, we'd like a negotiated settlement and a peace . . .' If he's really serious about this, I think it's fine."

Later in the interview, the president described the U.S. position by saying: "And we're willing to participate in anything, negotiations that will lead to, number one, the recognition that in El Salvador the solution must be by democratic means, not by someone trying to shoot their way into power."

However, White House officials said later that Reagan is not inviting negotiations with Castro. One official said the president intends to limit U.S. talks about the region to the Organization of American States and the Contadora Group.

The official said Reagan would prefer that negotiations be conducted through the OAS because he feels that the Contadora Group, is more "sympathetic to Cuba and the Soviet Union than the United States or the OAS would be." Castro repeatedly has repudiated the OAS as a tool of the U.S. government and rejected any suggestion of rejoining the body, which suspended Cuban membership 19 years ago.