The ruling military council and an opposition alliance agree to a three-year transition to civilian rule.