President Abdoulaye Wade of neighboring Senegal ordered troops to the border with Guinea-Bissau after recieving a panicked phone call from Viera in the night, and offered to send a plane to Bissau to get Vieira and his family, Wade's spokesman said. He said Viera has so far declined the offer.
Wade also called African Union commission chairman Jean Ping to alert him to the situation, Senegalese presidential spokesman El Hadj Amadou Sall said.
Ping issued a statement early Sunday saying the AU rejects "any unconstitutional change of government and condemns in advance any attempt to seize power by force."
In parliamentary elections held a week ago, opposition leader and former President Kumba Yala accused Viera of being the country's top drug trafficker. Viera did not comment on the accusation. The U.N. says impoverished Guinea-Bissau, on the Atlantic coast, is a key transit point for cocaine smuggled from Latin America to Europe.
Dozens of security forces surrounded the president's home in a residential area of the capital after hours of artillery and rocket-propelled-grenade fire. Inside, a reporter saw spent shell casings littering the floors, including in the president's bedroom.
The government of Guinea-Bissau had issued no formal statement, but is planning an emergency meeting later Sunday, spokesman Fernando Mendonca said.
The former Portuguese colony has a history of coups and misrule.
Vieira himself initially seized power in a 1980 coup. He was deposed in another coup in 1998 which ushered in a brief civil war.
In 2000, Yala won the presidential election, ruling until 2003, when he too was forced from power in a coup. Vieira won the 2005 presidential election and has ruled since then.
Yala's party lost seven seats in the 100-seat legislature in last week's election, while the governing party went from 45 seats to 67.
Carlos Gomes Jr, a former prime minister who now heads the ruling party, visited Vieira's house and said, "It's unacceptable in the 21st century to resolve our problems with violence."