MOSCOW (AP) — Kazakhstan authorities said Sunday that 164 people, including a 4-year-old girl, were killed in a week of protests that marked the worst unrest since the former Soviet republic gained independence 30 years ago.

The office of President Kassym-Jomart Tokayev said order has been restored in the Central Asian country and that the government has regained control of all buildings that were taken over by the protesters. Some of the buildings were set on fire.

Sporadic gunfire was heard Sunday in Almaty, the largest city in Kazakhstan, according to the Russian TV station Mir-24, but it was unclear whether those were warning shots by law enforcement. Tokayev said Friday he had authorized a shoot-to-kill order for police and the military to restore order.

The demonstrations, which began in the western part of Kazakhstan, began Jan. 2. over a sharp rise in fuel prices and spread throughout the country, apparently reflecting wider discontent with the authoritarian government. They prompted a Russia-led military alliance to send troops to the country.

U.S. Secretary of State Antony Blinken called Tokayev’s order “something I resolutely reject.”

“The shoot-to-kill order, to the extent it exists, is wrong and should be rescinded,” he said Sunday on ABC’s “This Week.”

“And Kazakhstan has the ability to maintain law and order, to defend the institutions of the state, but to do so in a way that respects the rights of peaceful protesters and also addresses the concerns that they’ve raised – economic concerns, some political concerns,” Blinken added.

The same party has ruled Kazakhstan since it gained independence from the Soviet Union in 1991. Anyone aspiring to oppose the government has either been repressed, sidelined, or co-opted, amid widespread economic hardship despite the country’s enormous reserves of oil, natural gas, uranium and minerals.

About 5,800 people were detained during the unrest, Tokayev’s office said.

The death toll of 164, reported by the state news channel Khabar-24 and citing the Health Ministry, was a significant increase from previously announced totals. It was unclear if that number referred only to civilians or if law enforcement deaths were included. Kazakh authorities said earlier Sunday that 16 members of the police or national guard had been killed.

The ministry said 103 of the deaths occurred in Almaty, and Kazakhstan’s ombudswoman for children’s rights said three of those killed were minors, including a 4-year-old girl.

The ministry earlier reported more than 2,200 people sought treatment for injuries, and the Interior Ministry said about 1,300 security officers were injured.

Almaty’s airport, which had been taken over by protesters last week, remained closed but was expected to resume operations Monday.

Tokayev said the demonstrations were instigated by “terrorists” with foreign backing, although the protests have shown no obvious leaders or organization. Sunday’s statement from his office said the detentions included “a sizable number of foreign nationals,” but gave no details.

It was unclear how many of those detained remained in custody.

The foreign ministry of neighboring Kyrgyzstan on Sunday called for the release of well-known Kyrgyz musician Vikram Ruzakhunov, who was shown in a video on Kazakh television saying that he had flown to the country to take part in protests and was promised $200. In the video, apparently taken in police custody, Ruzakhunov’s face was bruised and he had a large cut on his forehead.

The former head of Kazakhstan’s counterintelligence and anti-terrorism agency has been arrested on charges of attempting to overthrow the government. The arrest of Karim Masimov, which was announced Saturday, came just days after he was removed as head of the National Security Committee by Tokayev.

No details were given about what Masimov was alleged to have done that would constitute an attempted overthrow of the government. The National Security Committee, a successor to the Soviet-era KGB, is responsible for counterintelligence, the border guards service and anti-terrorist activities.

As the unrest mounted, Kazakhstan’s ministerial cabinet resigned but remained in their posts temporarily. Tokayev spokesman Brisk Uali said the president would propose a new cabinet on Tuesday.

At Tokayev’s request, the Collective Security Treaty Organization, a Russia-led military alliance of six former Soviet states, authorized sending about 2,500 mostly Russian troops to Kazakhstan as peacekeepers.

Some of the force is guarding government facilities in the capital, Nur-Sultan, which “made it possible to release part of the forces of Kazakhstani law enforcement agencies and redeploy them to Almaty to participate in the counterterrorist operation,” according to a statement from Tokayev’s office.

In a sign that the demonstrations were more deeply rooted than just over the fuel price rise, many demonstrators shouted “Old man out,” a reference to Nursultan Nazarbayev, who was president from Kazakhstan’s independence until he resigned in 2019 and anointed Tokayev as his successor.

Nazarbayev retained substantial power as head of the National Security Council. But Tokayev replaced him as council head amid the unrest. possibly aiming at a concession to mollify protesters. However, Nazarbayev adviser Aido Ukibay said Sunday that it was done at Nazarbayev’s initiative, according to the Kazakh news agency KazTag.