OUAGADOUGOU (Reuters) - Security forces in Burkina Faso foiled a coup attempt planned for earlier this month by about 30 ex-members of the elite presidential guard, known as the RSP, Interior Minister Simon Compaore said on Friday.

Compaore said the coup, which was scheduled to take place at midnight on Oct. 8, included a planned attack on the presidential residence, as well as on army barracks and a prison in the capital, Ouagadougou.

“Investigators from the judicial police discovered the ongoing preparation of a vast conspiracy aimed to destabilize the institutions of the republic and the seizure of power by force of arms,” he said.

Security forces initially clashed with the coup leaders on Oct. 8, when four former RSP members were stopped by police as they returned from a “neighboring country”. Two were killed in the confrontation that ensued.

Nineteen people have been arrested for trying to overthrow President Roch Marc Christian Kabore and his government. An investigation into the coup attempt is ongoing, Compaore said.

The coup attempt - led by an ex-RSP member called Gaston Coulibaly, Compaore said - marks the latest threat to Burkina Faso’s fragile security. In September last year, RSP soldiers loyal to a former president, Blaise Compaore - who is not related to the interior minister - mounted a six-day putsch attempt in which members of the cabinet were taken hostage.

The RSP was a pillar of Compaore’s rule before he was ousted by demonstrators in 2014 when he attempted to change the constitution to prolong his 27 years in office.