(CNN) Venezuelan President Nicolas Maduro on Wednesday gave US diplomats 72 hours to leave the country in response to the head of the National Assembly declaring himself acting president amid massive anti-government protests.

Hours after President Donald Trump officially recognized opposition leader Juan Guaido as the country's legitimate president, a defiant Maduro appeared before supporters to accuse the United States of backing an attempted coup.

Maduro announced that he was cutting remaining political and diplomatic ties with Washington. "We cannot accept the invasive policies of the empire, the United States, the policies of Donald Trump," he said to cheers from the crowd. "Venezuela is a land of liberators."

"We will not surrender," Maduro added.

The announcement came as thousands of Guaido backers took to the streets in a revitalized effort against Maduro, whose military response to the widespread demonstrations seemed more measured than in the past.

Trump vowed in a statement to use "the full weight of United States economic and diplomatic power to press for the restoration of Venezuelan democracy."

US Secretary of State Mike Pompeo reiterated the United States would support Guaido as he carries his duties as president and decides the status of the country's diplomats in Venezuela.

Maduro does not have "the legal authority to break diplomatic relations with the United States or to declare our diplomats persona non grata," Pompeo said Wednesday evening in a statement.

A senior Trump administration official dismissed as "meaningless" Maduro's order that diplomats leave the country within days.

The US Embassy in Caracas issued a security alert indicating that US diplomats and their families will be restricted to travel only within a few neighborhoods in Caracas and school-age children will be staying at home.

The embassy will remain open during regular business hours but all visa appointments for Thursday have been canceled, the alert said.

Organization of American States General Secretary Luis Almagro and many of Venezuela's neighbors expressed support for Guaido, whose opposition-controlled legislative body called for nationwide marches against Maduro's embattled administration.

Opposition supporters take part Wednesday in a Caracas march on the anniversary of a 1958 uprising.

Maduro and Guaido vie for power

Maduro addressed a sea of supporters wearing red -- symbolic of the government's socialist revolution -- from the balcony of the Miraflores presidential palace later in the day. He recounted a long history of "gringo interventions and coups" and said that only Venezuelans can elect and remove their government leaders.

"The imperial government of the United States is leading a coup attempt against us in order to install a puppet presidency that they can control in Venezuela," he said in a speech broadcast live on state broadcaster VTV.

The head of the country's highest court, Juan Jose Mendoza, urged the attorney general to "act immediately" in the face constitutional violations.

Venezuela's National Assembly head Juan Guaido appeared in a mass rally against Maduro on Wednesday.

Guaido responded to Maduro's speech via Twitter, telling all diplomatic missions and accredited staff that Venezuela "wants you to maintain your diplomatic presence in our country."

"Any messages to the contrary lack any validity, since they come from people or entities that have been characterized as usurpers," he said in the statement. "They have no legitimate authority to make any statements on this."

Sporadic clashes erupted after Guaido's swearing in -- with news footage showing National Guard members launching tear gas canisters at anti-government demonstrators near one of the main highways in the capital.

Prior to his dramatic swearing-in before throngs of supporters in the capital Caracas, Guaido, 35, said the day marked the beginning of an unstoppable movement to restore independence and democracy to the troubled nation.

These are the countries that support Guaido United States

Argentina

Brazil

Chile

Colombia

Costa Rica

Ecuador

Paraguay

Peru

"We know this will have consequences," Guaido said.

Calling Maduro a dictator and a tyrant, Guaido made an appeal for new elections.

"Raise your right hand, today, January 23rd, 2019, in my condition as president of the National Assembly, invoking the articles of the Constitution -- before almighty God," said Guaido, surrounded by supporters raising their hands in solidarity.

"I swear to formally assume the power of the national executive office as the president of Venezuela."

After the swearing in, Guaido and the crowd sang the national anthem.

Countries officially recognizing him as president include Agentina, Canada, Colombia, Peru, Chile, Brazil, Ecuador and Paraguay. European Council President Donald Tusk expressed support and called on other European countries to join him.

The anti-Maduro marches began at various points throughout the capital. Others were held throughout the country.

"The young people of my country need freedom," Grace Chacon said at a march in Caracas.

"We need to get loud. We need to be the voice of our country to say we are in trouble, we are in (an) SOS situation. ... We're fighting without guns. We're fighting without anything. We just have our hearts. We just have our courage."

Those behind Maduro rallied outside the Miraflores palace.

"We are here to reject any type of attempt to interfere with our nation," said Betulio Reyes, a pro-Maduro rally participant. "We are independent and sovereign and can decide on the fate of our own lives."

Jose Luis Gutierrez of Caracas vowed to "defend my country and my President against any foreign insurgency."

The protests took place on a highly symbolic date. Wednesday marks the 61st anniversary of a civilian and military uprising that overthrew former dictator Gen. Marcos Perez Jimenez.

Signs of unrest emerged earlier this week in Caracas. A small team of soldiers, claiming to be members of the armed forces, attempted an uprising against Maduro and triggered violent street protests

The protests come weeks after the start of Maduro's second term in power, with the nation continuing a deep economic crisis and dozens of other countries disputing his legitimacy.

Trump had mulled recognizing Guaido as president as top officials in the US administration ratcheted up their public statements against Maduro.

Depending on Maduro's response to the protests, Trump is prepared to take a range of actions in retaliation, including possible oil sanctions, two sources familiar with White House deliberations said.

As the good people of Venezuela make your voices heard tomorrow, on behalf of the American people, we say: estamos con ustedes. We are with you. We stand with you, and we will stay with you until Democracy is restored and you reclaim your birthright of Libertad. pic.twitter.com/ThzIAqBoRn — Vice President Mike Pence (@VP) January 22, 2019

US Vice President Mike Pence issued a message of support Tuesday to Venezuelans planning to join the marches.

"We are with you. We stand with you and we will stay with you until democracy is restored and you reclaim your birthright of libertad (freedom)," Pence said in a video posted on Twitter.

Pence said the United States maintains that Maduro "is a dictator with no legitimate claim to power" and reiterated the administration's policy in support of Guaido.

President Nicolas Maduro delivers a speech January 10 after being sworn in for a second term.

In response to Pence, Maduro had called for a "total, absolute revision" of Venezuela's diplomatic relations with the United States and said his government would take "political, diplomatic and defense decisions" to defend the country's democracy.

"Never before has an official of the highest level come out in the name of his government, he spoke on behalf of the President of the United States, to say that in Venezuela, the opposition must overthrow the government," Maduro said in a televised message.

Venezuelan officials accused Pence of backing a purported military uprising.

Anti-government protesters clash with security forces Monday in the Cotiza neighborhood of Caracas.

Wednesday's protests were expected to be the largest demonstration since 2017. Thousands clashed with security forces for months at that time, accusing Maduro of imposing a dictatorship. More than 120 people were killed in protest-linked incidents during that unrest.

On Tuesday, the National Assembly advanced efforts for an amnesty policy for civilians and military officials who would rise up against Maduro's government.

A day earlier, the Venezuelan Supreme Court ruled the National Assembly is illegitimate, and that no law discussed in the legislative body holds any legal value.

Maduro has continued the social welfare programs and price control policies of Hugo Chavez, who steered the country toward socialism before dying in 2013. Through nearly a decade of mismanagement, Venezuela has squandered its oil wealth, leaving its economy in tatters and Latin America reeling from a mass exodus of migrants in search of food and medicine.

The United Nations estimates as many as 3 million Venezuelans have fled since 2014.