BISSAU (Reuters) - Soldiers killed Guinea-Bissau's President Joao Bernado Nino Vieira on Monday, hours after the tiny West African state's army chief was killed in an attack, residents of the capital said.

Gunfire and the crump of heavier weapons resounded in Bissau city and it was unclear who was in control.

Two residents, who both declined to be identified, said they had been told by presidential guards that Vieira had been killed and his body was lying in his home.

The country of just 1.6 million people, a former Portuguese colony, has suffered years of coups and civil strife and has been used in the past few years as a conduit for smuggling Latin American cocaine to Europe.

Vieira is a former military ruler who was ousted during a civil war in the 1990s and returned to power in a 2005 election.

He had been at odds with armed forces chief of staff General Batista Tagme Na Wai, who was killed in an attack on Sunday evening.

Tensions are rife within Bissau's political establishment and security forces. In January, the armed forces command said militiamen hired to protect President Vieira had shot at Na Wai.

A member of the militia denied the shooting had been an assassination attempt, but the armed forces command nevertheless ordered the militia be disbanded.

The 400-strong force had been recruited as Vieira's personal bodyguard by the Interior Ministry after the president was targeted in a machinegun and rocket-propelled grenade attack on his residence on November 23 last year.

Analysts say political instability has been exacerbated in the past few years as Latin American drugs gangs have taken advantage of Guinea-Bissau's poorly policed coastline and remote airstrips to smuggle cocaine through Africa to Europe.

They say well-resourced drug cartels with access to weapons, speedboats and planes have been able to secure cooperation from senior officials in the armed forces and government in one of the world's poorest countries, whose main export is cashew nuts.

(Additional reporting by David Lewis in Dakar; writing by Alistair Thomson; editing by Matthew Tostevin)