ADDIS ABABA, Ethiopia — A coup attempt by a renegade general in one of Ethiopia’s largest regional states resulted in the death of four officials, including the national army’s chief of staff and the president of the region, the government announced Sunday.

Gunmen attacked an executive meeting of the Amhara regional state in the city of Bahir Dar on Saturday evening, killing its president, Ambachew Mekonnen, and his top adviser and grievously injuring the regional attorney general. Hours later, in the capital Addis Ababa, the bodyguard of army chief of staff Gen. Seare Mekonnen opened fire on him, killing the general and an associate.

Government spokeswoman Bilene Seyoum blamed the attacks on a recently amnestied brigadier general who had been imprisoned for his political views by the previous government several years before.

“The coup attempt and attack was orchestrated by Brig. Gen. Asaminew Tsige, the Amhara peace and security head with other agents,” she told journalists. “He and his colleagues were given amnesty over the last year by the new administration amid efforts to integrate them back to regular life.”

She said most of the perpetrators, including Seare’s bodyguard, were in custody and operations were underway to sweep up the remaining accomplices.

The Amhara region was “currently under 100 percent control,” she said.

Ethiopia, Africa’s second-largest country by population, is a key U.S. ally in the fight against terrorism in the Horn of Africa and an important source of stability in the restive region.

The country’s politics have undergone a dramatic change over the past year with the arrival of a new reformist prime minister who has invited back exiled opposition politicians and guerrilla groups and freed thousands of political prisoners.

Asaminew was imprisoned by the previous regime for his opposition to the government, and his release and appointment to head of security was part of the larger reconciliation process.

The new freedoms, however, have allowed long-simmering tensions to rise to the surface, and millions have been displaced in ethnic-based land conflicts around the country.

In 2018, with some 3 million driven from their homes, Ethiopia had the largest number of newly displaced people in the world.

There has also been a great deal of political ferment in the ethnic-based regions that make up the country, with the rise of nationalist ethnic groups pushing for greater regional autonomy from the central government.

As news of the coup attempt in Bahir Dar and the attack on the chief of staff’s home in the heart of the capital spread late Saturday, social media exploded with rumors and speculation over what was taking place. Within a few hours, access to the Internet was shut down, and army and police checkpoints were installed around the capital.

Prime Minister Abiy Ahmed appeared on television at midnight dressed in military fatigues to call for calm and reassure the country that the situation was under control.

Since coming to power, Abiy has made peace with longtime rival Eritrea and has been active in brokering peace deals between fractious neighbors in the region.

Most recently, he has been active in mediating between the military transitional rulers in Sudan and protesters there.