Mr. Viera took power in a 1980 coup and ruled 19 years until he was ousted during a civil war .