War and peace issues dominated a pointed and sometimes biting debate between President Carter and Ronald Reagan tonight, with both candidates pledging their devotion to world peace and U.S. military strength.

In a nationally televised debate, conducted largely on the president's favorite campaign battleground, Reagan repeatedly insisted that he desired a real reduction in nuclear armaments and would negotiate with the Soviets "as long as it takes" to get an agreement.

But Carter said that Reagan's opposition to the strategic arms limitation treaty (SALT II) as well as what the president viewed as Reagan's insensitivity to nuclear proliferation were "dangerous" and "disturbing" opinions.

The debate, sponsored by the League of Women Voters in Cleveland's Convention Center and viewed by a television audience that may have reached 100 million Americans, was viewed as potentially pivotal by both camps because of the closeness of the presidential race and the short time remaining for campaigning.

Reagan and his strategists had hoped that Carter's record on economic issues would be a focal point tonight. But the exchanges between the two major candidates on this issue were largely bloodless, with both men deploring inflation and taking jabs at the other for misrepresenting their records as governor.

While each candidate remained carefully in control of his emotions throughout the 90-minute forum, there was little cordiality between the Democratic president and his Republican challenger.

Carter said that Reagan advocated "extremely dangerous" ideas in "a quiet voice." Reagan, while defending his call for a SALT II and his opposition to SALT II, likened Carter to "the witch doctor who gets mad when a doctor comes along with a cure that will work."

Afterward, Carter was in high spirits when he appeared before hundreds of supporters at this hotel here. He said the debate had been "a very fine opportunity for me and Gov. Reagan to draw sharp distinctions."

Reagan, appearing before his supporters a few moments later, said, "I feel great. It was wonderful to finally to be able, in front of the American people, to respond to some of the accusations, some of the charges, some of the ridiculous things that have been said in this campaign."

The first question to the candidates, asked by Marvin Stone, editor of U.S. News & World Report, produced the sort of exchange that has dominated the campaign in the past weeks.

Asked to describe the differences between him and the president on war-and-peace issues, Reagan criticized Carter's military budget as insufficient, but said that as president he would use force only as "a last resort."

"We cannot shirk our responsibility to the free world, because we're the only ones who can do it," Reagan said. "Maintaining peace requires strength."

Reagan maintained, in response to a follow-up question, that his five-year economic plan would provide for overall budget cuts, military spending increases and tax cuts at the same time because the plan called only for a cut in tax rates -- not in the total taxes that would be collected.

Carter, replying to the same question with words from his stump speech, said that simple answers to complicated questions on military matters were "neat, plausible and wrong."

The president cited his work for a peace treaty between Israel and Egypt, and contended that the United States has sufficient military power to deal with any "foreseeable eventuality" in the Persian Gulf.

Carter maintained that he had reversed declining defense budgets that had occurred under Republican presidents. Reagan, replying, said that Carter's figures were inaccurate because they did not take into account the winding down of the Vietnam war.

As he often has in the past, Reagan criticized Carter for eliminating the B1 bomber and delaying the Trident missile.

Carter, replying with sharp language, said, "Habitually, Gov. Reagan has advocated the injection of force into troubled areas. . . ."

The second question, from Harry Ellis of The Christian Science Monitor, turned the debate to the subject of inflation, and resulted in a sharp exchange between the two candidates over their records as governors.

Carter seized on the question to attack Reagan's support for a 30 percent tax cut over three years. Calling this a "ridiculous idea," the president said it would require a $130 billion cut in federal spending if Reagan was also to balance the federal budget, as he has promised.

When Carter attacked Reagan's record as governor of California, charging that he oversaw the three largest tax increases in the state's history, a clearly prepared Reagan responded that taxes rose even higher on a per-capita basis in Georgia when Carter was governor there.

Contending that inflation can be brought under control by cutting government waste and fraud, Reagan said, "We don't have inflation because the people are living too well. We have inflation because the government is living too well."

Both candidates restated their basic economic programs in response to the inflation question. Carter said the answer lies in his energy policy and a proposal to revitalize industry. Reagan called for increased productivity and a reduction in government spending.

Questions from William A. Hilliard of The Portland Oregonian about policies toward cities and minorities produced softly spoken but fundamentally opposing answers from the candidates.

Carter, responding to a previous question, had accused Reagan of opposing the minimum wage, calling this "a heartless kind of approach to working families which is typical of the Republicans."

Reagan said he was opposed only to a minimum wage for teen-agers. This, he said, had systematically eliminated jobs for black youths. In Detroit, he said, black unemployment was at 56 percent.

The Republican nominee repeated his campaign proposal for inner-city "development zones" in which businesses would be given tax breaks to employ local residents.

Carter pointed to his record as president, and said that in the last four years tensions in cities had decreased and employment had increased.

Reagan pledged to work for "full equal opportunity," and referred to a time when "we didn't know we had a racial problem."

Carter responded that those who were being discriminated against were well aware of it.

"We've gone a long way in correcting it [racial discrimination], but we certainly have a long way to go," the president said.

The issue of the American hostages in Iran was raised by Barbara Walters of ABC News, who asked the two candidates if they had a specific policy to deal with international terrorism.

The president used the question to get at the subject he was clearly most anxious to discuss before the huge national audience -- Reagan's stand on nuclear arms control.

Calling the possibility that terrorist organizations might gain access to nuclear devices "the ultimate threat" of terrorism, Carter said, "Both I and my predecessors have had a deep commitment to controlling nuclear weapons. But when Gov. Reagan is asked about this, he makes a very disturbing comment that the nonproliferation of nuclear weapons is none of our business."

Clearly appealing to Jewish voters, who are so important to his reelection chances, the president also criticized terrorism directed at Israel, and restated his opposition to the Palestine Liberation Organization.

When it was Reagan's turn, he told Walters, "Barbara, you've asked that question twice, you deserve at least one answer."

Reagan also criticized Carter's human rights policy as "kind of hypocritical" because the United States is "at the same time maintaining detente with the one nation where there are no human rights, the Soviet Union." He defended his recent reference to the fact that he has "some ideas" about freeing the American hostages, but said he would not discuss it in public for fear of jeopardizing them. And he criticized Carter for not beefing up security at the U.S. Embassy in Tehran before the hostages were taken.

With the final word in this exchange, Reagan also denied that he had ever said that nuclear nonproliferation is "none of our business."

One of the sharpest clashes in the debate, as it has been in the campaign, came over the issue of strategic arms control. Carter used the word "dangerous" a half dozen times to describe Reagan's opposition to SALT II.

"There is a disturbing pattern to the attitudes of Gov. Reagan," the president said, adding that his opponent had opposed every variant of arms control, including the limited nuclear test ban treaty and the first strategic arms limitation agreement.

Representing SALT II as the product of long negotiations under different presidents, Carter said, "When a man who hopes to be president says, 'Take this, destroy it, do not debate it . . . do not capitalize on these long negotiations,' that is a very dangerous and disturbing thing."

Reagan, replying with some vigor, said Carter was misrepresenting his position. The GOP nominee said Carter's negotiators had come up with a bad treaty that did not reduce nuclear arms and was "illegal" because it was unequally weighted in favor of the Soviet Union.

Reiterating his support for a new arms limitation treaty, Reagan said. "I am not talking about scrapping. . . . I will say to the Soviet Union, 'We will negotiate with you as long as it takes . . . to have a legitimate reduction in nuclear arms so that neither of us will represent a threat to the other.'"

The two disagreed sharply, particularly over Reagan's record as governor of California, when asked if it is possible to lessen U.S. dependence on foreign oil without serious damage to the environment or steadily higher prices.

Asserting that the country is energy rich in natural resources such as coal, Reagan blamed the overdependence on oil largely on federal regulations, which he said hampered both the coal and nuclear power industries.

Carter, defending his energy policies, accused Reagan of opposing "regulations that affect the lives and health of miners and the quality of our air and water." Of Reagan's opposition to the "Windfall profits" tax, the president said, "He wants to put all our eggs in one basket and turn that basket over to the oil companies."

"That, of course, is a misstatement of my position," replied Reagan, who boasted that, while he was governor, California approved the strictest air-pollution law in the country.

But in his rebuttal, Carter charged that that law was passed over Reagan's objections. "The only thing the president must be thinking of," Reagan responded, was a proposed federal pollution regulation he said would have wrecked the economy of California.

On the politically sensitive issue of Social Security, each candidate pledged to preserve the integrity of the system and accused his rival of frightening elderly people into thinking that the system would be reduced or destroyed.

Reagan said the system is not sound in the long run and that he would appoint a task force to study how to make it sound with the provision that the benefits of anyone already on the system not be reduced.

Carter claimed that a preliminary report of one Reagan task force already advocated reduction of future cost-of-living increases.

The president also charged that Reagan "began his political career" by opposing Medicare.

"There you go again," Reagan said to Carter with a smile, as the audience in the convention center responded with laughter. Reagan said he had opposed one Medicare bill and supported another and that he favored the concept of medical care for the elderly.

In the final question of the debate, each candidate was asked why people should not vote for his opponent, and each man used it to bring up what he believes are his strongest issues in the campaign. Carter talked about war and peace, while Reagan concentrated on Carter and the economy.

The president accused Reagan of making "a radial departure" from the traditions of the Republican Party on issues such as the Equal Rights Amendment, and said he was disturbed by Reagan's position on nuclear arms control and by his "inclination" to propose the use of American military power in a number international trouble spots.

"The most important question is the control of nuclear weapons," he said. "No president wants war, and I do not believe that Gov. Reagan, if he were president, would want war. But a president has to make almost daily judgments on how to use the enormous power of our nations."

Reagan replied that Carter's answers showed that he seeks additional government programs to solve virtually every problem. Citing the rise in unemployment and inflation since the 1976 campaign, Reagan said, "I think this suggests something" about Carter's right to remain in the White House.

Reagan also defended his opposition to the ERA, and said he was a strong advocate of women's rights, but not by means of the proposed constitutional amendment.