The Reagan administration moved yesterday to take credit where it had previously feared to tread, praising peace talks in El Salvador between President Jose Napoleon Duarte and leftist guerrilla forces as the product of U.S. policy in the region.

State Department spokesman John Hughes told reporters that the talks "would seem to underline the significance of what we have been trying to do in El Salvador." A senior official called the talks "vindication" of U.S. policy.

"As the military situation improved because of U.S. aid, it created a climate [within the Salvadoran armed forces] in which negotiations could take place," the official said. "As the guerrillas do worse, they are also more inclined to talk. That's what happening now . . . .the whole picture constitutes a vindication of U.S. policy."

The administration has historically hesitated to endorse talks between government and leftist guerrilla forces. U.S. Embassy officials reportedly tried to discourage Duarte from arranging yesterday's meeting at La Palma, arguing that there was too great a risk of backlash from Salvador's deeply entrenched right wing.

Another State Department official acknowledged only that U.S. officials were "skeptical" when Duarte told them Oct. 6 in San Salvador that he would propose the talks in his speech to the United Nations two days later. "There were reservations: will the military go along with it, will they help actively rather than sit on their hands; have you thought it all through, are there guarantees, things like that," the official said.

Defense Minister Eugenio Vides Casanova accompanied Duarte to the meeting and wore his Army uniform in apparent demonstration of military support for the talks. The State Department officials said offers made by Duarte to the guerrillas during the five-hour session at La Palma corresponded to those Duarte had long offered with U.S. backing.

According to announcements at the site, the offer included a general amnesty in return for guerrilla participation in municipal and National Assembly elections scheduled for February, the right to hold rallies and campaign and a guarantee that Salvadoran armed forces would not retaliate against rebel candidates or supporters. The official said "much more than that" is on the table but would not elaborate.

"This is what we wanted to see happen. It's what we were aiming for all along" in pushing for land reform, last May's elections and an end to human-rights abuses, the official said. He noted that Duarte maintained the U.S. position against sharing power with guerrillas before an election.

Secretary of State George P. Shultz, appearing on NBC's "Today" show, said the Reagan administration is in "fundamental agreement" with Duarte on the talks' goal, which, he said, is to achieve "a process within a framework of the Salvadoran constitution. President Reagan has very vigorously endorsed that position."

At the University of Alabama yesterday, Reagan called the talks "momentous" and said his prayers were with Duarte. "President Duarte is participating at great personal risk . . . a risk worth taking," Reagan said.

U.S. Ambassador to El Salvador Thomas R. Pickering told National Public Radio of the meeting, "I'm telling you the absolute truth when I say that it was Mr. Duarte's idea, Mr. Duarte's initiative and obviously Mr. Duarte who is seeing it through."

"Anybody who knows Washington well, and who could have ever thought . . . that we could produce an idea this dramatic, this far-reaching and this forward moving, without having it leak out in the sieve that is Washington, must know and understand that," Pickering said. The United States sent no official delegation to the parley, but Sen. Paul E. Tsongas (D-Mass.) was in La Palma at the invitation of both sides and Rep. James M. Shannon (D-Mass.) went as a side trip of a preplanned private visit, according to an aide.

Tsongas said he had been working for the talks during seven months of meetings with the guerrillas and had intended to accompany them from the airport to La Palma but that his plane was delayed. The scene there, he said, was "very moving . . . Duarte has tapped a tremendous reservoir of feeling for peace" among Salvadorans.