Venezuelan President Hugo Chávez said Friday that his government will close its consulate in Miami after the U.S. government expelled a diplomat after allegations surfaced that she discussed possible cyber-attacks on U.S. soil while she was stationed at her country's embassy in Mexico.

Chávez said he decided the consulate will shut its doors in response to what he called an unfair action by the U.S. State Department.

"We're going to close it. It's OK. There won't be a consulate in Miami," Chávez said during his annual speech to the National Assembly.

Livia Acosta Noguera, Venezuela's consul general in Miami, was ordered out of the U.S. last weekend followed an FBI investigation into allegations that she discussed a possible cyber-attack on the U.S. government while she was assigned to the Venezuelan Embassy in Mexico. The allegations were detailed in a documentary aired by the Spanish-language broadcaster Univision.

There's no proof that she was going around carrying out espionage.

- Hugo Chávez, President of Venezuela

The documentary was based on recordings of conversations with her and other officials, and alleged that Cuban and Iranian diplomatic missions were involved. Citing audio and video obtained by the students at the National Autonomous University of Mexico, Univision said Acosta was seeking information about the servers of nuclear power plants in the U.S.

"There's no proof that she was going around carrying out espionage," Chávez said. He said he thought "pressure by sectors of the far-right" in the U.S. were behind her expulsion.

Chávez said the government decided on an "administrative closing of the consulate while we study the situation." It's unclear what the government intends to do with other diplomats stationed in Miami.

Responding to Chávez's announcement, U.S. State Department spokesman Mark Toner said: "The decision on how to manage its consulates and how to provide consular services to Venezuelan citizens is entirely that of the Venezuelan government."

The consulate in Miami, which covers the states of Florida, Georgia and the Carolinas, is one of Venezuela's largest in the United States. According to U.S. Census figures, the number of Venezuelans in the United States increased from 91,500 in 2000 to 215,000 in 2010.

The Organization of Venezuelans in Exile says 160,000 to 200,000 of those Venezuelans live in Florida.

Closing the consulate is "a maneuver by Chávez to impede the ... (October) presidential elections in Miami, which is the most important electoral center" for Venezuelan voters outside their home country, said Elio Aponte, president of the exile group.

In the last presidential vote in 2006, about 15,800 Venezuelans voted in the United States, three-fourths of them at the Miami consulate.

Chávez announced the closure in the middle of his state-of-the-nation speech, which lasted more than nine hours.

The leftist president repeated his criticisms of the United States, calling its government "a threat for the world."

Chávez also said he expects a "year of tests" as he runs for re-election, and he pledged to hand over the presidency if he loses.

Chávez has been in office for 13 years and is seeking another six-year term in the October vote. Chávez told opposition lawmakers that if he loses, he "would be the first in recognizing it."

Recent polls say Chávez's popularity has been above 50 percent.

Before his speech, hundreds of supporters wearing the red shirts of his political movement gathered outside the National Assembly and cheered, some of them chanting Chávez's name.

Opponents criticize Chávez's handling of problems such as rampant violent crime and 27.6 percent inflation.

Some opposition lawmakers briefly addressed Chávez, including presidential hopeful Maria Corina Machado, who challenged him to a debate and called his frequent expropriations of private businesses "robbery."

"You've called me a thief," Chávez told her. "You don't make the ranking to debate with me."

Chávez touted the country's 4 percent growth last year and noted that under prior governments inflation was far higher. He said it's important for his government to take steps to reduce inflation.

He defended policies including his recent decision to withdraw billions of dollars in its gold reserves from U.S. and European banks and bring it back to the Central Bank in Caracas. Holding up a bar of gold, he criticized prior governments, saying: "They had taken our gold away."

The former paratroop commander has boosted military spending in recent years, and Chávez said the country will soon begin receiving anti-aircraft missiles. He has previously said Russia is supplying the missiles to Venezuela.

Referring to his struggle with cancer, the 57-year-old president reiterated that he has overcome the illness after undergoing surgery and chemotherapy.

"I needed cancer. I give thanks to God," Chávez said, explaining that the illness had forced him to slow down and reflect.

Turning to international affairs, Chávez defended Iran and its nuclear program, reiterating his view that U.S. concerns about Iran trying to build atomic weapons are baseless. He defended his relationship with Iranian President Mahmoud Ahmadinejad, who visited Latin America this week.

"He's a good man. He's not any religious fanatic," Chávez said.

In spite of his latest spat with Washington, Chávez said his government is willing to have good relations with all countries including the U.S. He said one of his government's achievements during 2011 was lowering tensions and improving relations with neighboring Colombia, a close U.S. ally.

Chávez has long been embroiled in tensions with the United States, while Venezuela remains heavily dependent on oil sales to the U.S.

The U.S. Embassy in Caracas has been without an ambassador since July 2010. Chávez rejected the U.S. nominee for ambassador at the time, accusing him of making disrespectful remarks about the Venezuelan government. That led Washington to revoke the visa of the Venezuelan ambassador to the U.S.

Based on reporting by the Associated Press.

Follow us on twitter.com/foxnewslatino

Like us at facebook.com/foxnewslatino