Soldiers ousted the democratically elected president of Honduras on Sunday and Congress named a successor, but Manuel Zelaya denounced what he called an illegal coup and vowed to stay in power. The first military takeover of a Central American government in 16 years drew widespread condemnation from governments in Latin America and the world - including the US - and Venezuelan President Hugo Chavez vowed to overthrow the country's apparent new leader. "I want to return to my country," Zelaya said in Costa Rica, where he arrived in forced exile on Sunday. "I am president of Honduras." The Honduran congress voted to accept what it said was Zelaya's letter of resignation, with even the president's former allies turning against him. Congressional leader Roberto Micheletti was sworn in to serve until January. 27 when Zelaya's term ends. Micheletti belongs to Zelaya's Liberal Party, but opposed the president in the referendum. Zelaya denied resigning and insisted he would serve out his term, even as the Supreme Court backed the military takeover and said it was a defense of democracy. Meanwhile on Sunday evening, the Ministry of Foreign Affairs issued a travel warning, advising Israelis to refrain from densely populated areas and political gatherings in Honduras due to the current 'political instability' in the country. Soldiers awakened the president by gunfire and detained while still in his pajamas early on Sunday morning, hours before a constitutional referendum many saw as an attempt by him to stay in power beyond the one-term limit. An air force plane flew him into forced exile in Costa Rica as armored military vehicles with machine guns rolled through the streets of the Honduran capital and soldiers seized the national palace. He left late Sunday on a plane provided by Chavez, bound for Nicaragua where he was to attend a scheduled meeting of Central American presidents the following day. Zelaya called on Honduran soldiers to back him, urged citizens to take to the streets in peaceful protests, but only a few hundred turned out at the main protests in the capital. Micheletti was sworn in at a ceremony inside the Congress building with cheers and chants from fellow legislators of "Honduras! Honduras!" Outside of Congress, a group of about 150 people opposed to Zelaya's ouster stood well back from police lines and shook their fists, chanting "Out with the bourgeoisie!" and "Traitors!" Within hours, Micheletti declared a nationwide, 9 p.m. to 6 a.m. curfew for two days starting Sunday night. He told a news conference he had appointed a new foreign minister: lawyer and former Ambassador to the UN Enrique Ortez Colindres. Micheletti insisted that he did not arrive at his new post "under the aegis of a coup d'etat." "I have reached the presidency as the result of an absolutely legal transition process," he said. He also defended the army, saying "the armed forces have complied with the constitution and the laws." But he warned against outside interference after Chavez remarked that if Micheletti was appointed president, "We will overthrow him." Some of Zelaya's cabinet members had been detained by soldiers or police following his ouster, according to former government official Armando Sarmiento. And the rights group Freedom of Expression said leftist legislator Cesar Ham died in a shootout with soldiers trying to detain him. A Security Department spokesman said he had no information on Ham. Micheletti acknowledged that he had not spoken to any Latin American heads of state, but said, "I'm sure that 80 to 90 percent of the Honduran population is happy with what happened today." He also announced that Zelaya would be welcome to return to Honduras as a private citizen on one condition: "Without the support of Mr. Hugo Chavez, we would be happy to take him back with open arms," he said. Countries throughout Latin America and the world condemned Zelaya's expulsion. Chavez said Venezuela "is at battle" and put his military on alert. US President Barack Obama said he was "deeply concerned" and US Secretary of State Hillary Clinton said Zelaya's arrest should be condemned. "I call on all political and social actors in Honduras to respect democratic norms, the rule of law and the tenets of the Inter-American Democratic Charter," Obama's statement read. For those conditions to be met, Zelaya must be returned to power, US officials said. Two senior Obama administration officials told reporters that US diplomats are working to ensure Zelaya's safety as they press for restoration of constitutional law and his presidency. One of the officials said that the US has been in touch with Zelaya since he was brought to Costa Rica, and has been trying to communicate with members of the Honduran Congress to insist that the new power structure step down. The officials said that the Obama administration in recent days had warned Honduran power players, including the armed forces, that the US would not support a coup, but Honduran military leaders stopped taking their calls. The officials briefed reporters by phone Sunday on condition of anonymity, under ground rules set by the State Department. The Organization of American States approved a resolution Sunday demanding "the immediate, safe and unconditional return of the constitutional president, Manuel Zelaya." UN Secretary-General Ban Ki-moon condemned the coup and "urges the reinstatement of the democratically elected representatives of the country," said his spokeswoman, Michele Montas. The Rio Group, which comprises 23 nations from the hemisphere, issued a statement condemning "the coup d'etat" and calling for Zelaya's "immediate and unconditional restoration to his duties." In Havana, Cuban Foreign Minister Bruno Rodriguez vowed to work with allies to push for Zelaya's return to power. He said Cuban Ambassador Juan Carlos Hernandez was held briefly in Tegucigalpa after he and other foreign diplomats tried unsuccessfully to prevent soldiers from taking away Honduran Foreign Minister Patricia Rodas. Chavez said troops in Honduras temporarily detained the Venezuelan and Cuban ambassadors and beat them. Coups were common in Central America for four decades reaching back to the 1950s, but Sunday's ouster was the first military power grab in Latin America since a brief, failed 2002 coup against Chavez. It was the first in Central America since military officials forced President Jorge Serrano of Guatemala to step down in 1993 after he tried to dissolve Congress and suspend the constitution. "We thought that the long night of military dictatorships in Central America was over," said Costa Rican President Oscar Arias, who sat beside Zelaya at a news conference. Zelaya told the Venezuela-based Telesur network that he was awoken by gunshots and the shouts of his security guards, who he said resisted troops for at least 20 minutes. Still in his pajamas, he jumped out of bed and ducked behind an air conditioner to avoid the bullets, he said. He said eight to 10 soldiers in masks escorted him onto an air force plane that took him to Costa Rica. About 100 supporters congregated in front of locked gates outside the national palace, where they hurled rocks at soldiers and shouted "Traitors! Traitors!" They hung a Honduran flag. "They kidnapped him like cowards," screamed Melissa Gaitan. Tears streamed down the face of the 21-year-old, who works at the government television station. "We have to rally the people to defend our president." Many union and farm groups supported Zelaya's push for the referendum - which he said was aimed at changing policies that have excluded the nearly three-quarters of Hondurans who live in poverty. The vote did not take place on the referendum, which asked whether another vote should be held on convoking an assembly to rewrite the constitution.