A senior State Department official yesterday called on the feuding factions in El Salvador's bloody civil war to join in seeking a peaceful political solution through elections, and he warned the leftist guerrillas there that the United States will continue resisting their attempts to achieve power by force.

In a speech intended as a major policy declaration, Thomas O. Enders, assistant secretary for inter-American affairs, said that "the search for a political solution will not succeed unless the United States sustains its assistance to El Salvador."

Enders' remarks to the Washington World Affairs Council were a signal that the Reagan administration's conversial policy of providing arms, military advisers and money to El Salvador's civilian-military junta will continue. But his message was couched in terms carefully designed to reassure critics that the policy is not merely a means of combatting alleged communist expansion in the hemisphere by supporting repressive rightist forces.

Prompting the Enders speech was a growing feeling within the administration that its policy in El Salvador had gained little popular support in this country or among U.S. allies and that a new effort had to be made to change perceptions of administration goals by dropping the Cold War rhetoric and emphasizing the more positive aspects.

Enders repeated the now familiar administration assertions that Cuba is attempting to spread subversion throughout Central America and, after a pause, has resumed an "ominious upswing" of arms smuggling to the guerrillas through Nicaragua.

In the main, though, Enders carefully avoided the references to East-West conflict and the talk about "drawing the line" against Cuba and the Soviet Union indulged in by Secretary of State Alexander M. Haig Jr. and other senior administration officials earlier this year.

Instead, the thrust of his message was to underscore U.S. support for political and economic reform in El Salvador, deplore violence by extremists of both the left and right, warn the Salvadoran military that it must do more to crack down on repressive activities by forces under its control and appeal to "all parties that renounce violence . . . to participate in the design of new political institutions and the process of choosing representatives for them."

Referring to plans for writing a new constitution next year and following them with presidential elections in 1983, Enders said this timetable offers the best hope for bringing an end to the Salvadoran bloodshed.

"We have no preconceived formulas," he said. "We know that elections have failed in the past. . . . But we believe that elections open to all who are willing to renounce violence and abide by procedures of democracy can help end El Salvador's long agony."

In a warning to the guerrillas, Enders said El Salvador's leaders, backed by U.S. aid, "will not grant the insurgents through negotiations the share of power the rebels have not been able to win on the battlefield. But they should be -- and are -- willing to compete with the insurgents at the polls."

"The point is not that sustained U.S. assistance might lead to a government military victory," he said. "It is that a political solution can only be achieved if the guerrillas realize they cannot win by force of arms."

Despite the conciliatory tone, his words amounted to a rejection of the idea being pushed by some West European and Latin American governments that efforts should be made to start negotiations with the guerrillas. Another variation on that theme was put forward yesterday by Rep. Stephen J. Solarz (D-N.Y.), who recently concluded a Latin American trip that included talks with Cuban President Fidel Castro and Nicaraguan and Salvadoran leaders.

Solarz said that elections should be preceded by the working out of a peace plan between the guerrillas and ther government of President Jose Napoleon Duarte if there is to be a durable solution. Referring later to the tacit rejection of that idea in Enders' speech, Solarz called it "putting the best face on a bad policy."