Young officers at the head of 2,000 troops and backed by armored cars and artillery surrounded the presidential palace today and forced the resignation of President Romeo Lucas Garcia in favor of a three-man military junta under the presidency of retired general Efrain Rios Montt.

Rios Montt, who claimed presidential victory as a relative centrist in 1974 elections only to see the military establishment's canididate emerge victorious, went on nationwide radio and television to pledge that his government would guarantee the nation "peace, work and security."

The general, who faced the cameras with his colleagues dressed in camouflage Army uniforms, made it clear in an often shrill speech that he would brook no nonsense from either the "cheap politicians" who had almost brought the country to ruin nor from armed civilians, either rightists or leftist, who have shed the nation's blood. No significant violence was reported today.

Rios Montt told reporters at the presidential palace that Lucas Garcia, elected president four years ago, had been taken to the international airport for a flight out of the country. Lucas Garcia had backed another general, Angel Anibal Guevara, who was elected president earlier this month in balloting that his opponents charged was rigged. Guevara had been scheduled to take office July 1.

Despite Rios Montt's centrist tie--he was the Christian Democrats' candidate in 1974--it was not clear how much of the armed forces supported the coup, whether Rios Montt was more than a figurehead, and where the main leaders fit in the generally conservative political spectrum. There was some evidence that they represented the extreme right.

The broadcast statement was read by Leonel Sisniega Otero, the vice presidential candidate of the National Liberation Movement, which was considered the most conservative party entered in the election that was boycotted by leftists.

In Washington, Secretary of State Alexander M. Haig Jr. was asked about the coup and said, "We are following it very closely. It's too early to make any substantive comment, and I'll reserve on that until the situation is clarified."

The political coloration of the coup makers is crucial to any hopes of achieving international recognition. The U.S. government, concerned by mounting left-wing guerrilla activity in this nation bordering Mexico, had looked to this month's elections as a means to legitimize resumption of military aid here. Aid was cut off after U.S. and international human rights groups convincingly linked the government to killings by right-wing death squads that now are estimated to run as many as 300 a month.

The disputed elections failed to provide a clear indication of a way out of the deepening military and economic crises that have increasingly weighed on Guatemala's defense establishment, its business community and even the rightist politicians who have supported the military-dominated governments that have followed the U.S.-organized overthrow of Jacobo Arbenz in 1954.

During the past six months, the military has fought an escalating guerrilla war against a newly unified front of four Marxist insurgent forces without receiving any direct American military aid and has spent its dwindling foreign exchange reserves on arms purchases from Israel and other suppliers willing to overlook the human rights abuses that led to the American aid suspension. The growing sophistication of the guerrillas, who the government says are supported by Cuba and the Soviet Union, has disturbed senior military commanders.

Haig has described Guatemala as "clearly the next target," adding that from here, "the run into Mexico is a very short one."

Rios Montt said he would dissolve Congress and rule by decree along with two other junta members, Gen. Horacio Maldonado Shad and Col. Francisco Gordillo.

"Please gentlemen, all you civilians who are armed, remember to take the machine guns off your roofs and turn them in," the junta president said, "and take the pistols from your belts and pick up a machete and go to work."

The general, who appeared not to have been actually in on the coup by lietenants and captains and who was only made head of the junta after being summoned to the prsidenial palace by radio announcements, told guerillas who have been waging a bitter war against the government for more han four years to lay down their guns. "If you don't, we will take them from you."

Rios Montt said his junta would rule in the name of the military and would keep politicians at arm's length. He promised his new junta would soon elaborate a program of reforms.

The sudden coup, which came two weeks and a day after national elections to select a successor to Gen. Lucas Garcia caught the nation by surprise. The young officers and troops from one of the Army's capital-based garrisons materialized around the palace downtown at 10 a.m.

Rios Montt said Lucas Garcia and Guevara "have imposed a government on us that does not represent the people." He said elections would be held for a new government, but gave no date. He also said "there is no state of siege in the country," and "there is freedom of information but not of political propaganda."

The junta leader vowed to "change Guatemala's image by way of its foreign relations, especially with the United States," which has criticized Guatemala's human rights record in the past. "The most important thing at this moment is to remove the country's isolation, to reactivate the economy and build confidence for capital investment."

Financially, the country is in desparate condition, having had to pay off $600 million in short- and medium-term debts at the end of last year when American and other foreign banks refused to refinance the existing debt or to extend new credits. As of March 1, a diplomatic analyst said in Guatemala City recently, the country was totally out of foreign exchange reserves, and poor market prices for Guatemala's agricultural exports promised little if any relief.

U.S. diplomats, Guatemala's politicians and even some of its leading military commanders voiced hopes in the week before the March 7 voting that a result that could be sold to the U.S. Congress as a free and fair election would unlock U. S. economic and military aid and convince international institutions and banks to come back into Guatemala.

Ambassador Frederic Chapin said in a speech just before the vote that U.S. aid would resume only if the results showed Guatemala was on the road to a representative political system. The Reagan administration, anticipating such a result, put a symbolic $250,000 request for military aid to this country in the fiscal 1983 budget request.

The U.S. hopes appeared to evaporate when the three conservative opponents to Guevara united to charge massive fraud in the voting and were roughed up by riot police when they tried to present a letter protesting fraud.

Associated Press added from Guatemala City:

In broadcasts over national radio and television, the coup leaders said the March 7 election won by Guervara was fraudulent, and they promised to restore "peace and authentic democracy to Guatemala."

Guevara did not receive the required majority in the national balloting, but got more votes than any of the three civilian candidates and Congress elected him president at a March 14 session. He had been scheuled to replace Lucas Garcia in July and begin a four-year term.

The National Liberation Movement's candidate, Mario Sandoval Alarcon, said in campaign that he had won the 1978 elections but was cheated out of the victory by Gen. Lucas. Sandoval threatened then that he would not accept another fraud. Sandoval and his party control a heavily armed civilian force that has been accused of a number of assassinations of centrist party workers and leaders.