JOHANNESBURG (AFP) - A 15-year-old South African girl was on Sunday pulled from a flight moments before trying to leave the country to join the Islamic State in Iraq and Syria (ISIS), state security said.

"We can confirm that she was planning to leave the country with the intention of joining ISIS and had been actively engaged with social media networks," State Security Minister David Mahlobo told local daily, The Star.

The girl was reported missing by her grandparents on Sunday morning when she disappeared from her Cape Town home. She was found on a British Airways flight bound for Johannesburg later that day.

The girl was reportedly heading for Turkey, where she was allegedly planning to cross the border into Syria.

According to local reports, investigators found evidence in the girl's room linking her to recruiters for ISIS, militants who have captured swathes of Syria and Iraq and who have attracted hundreds of foreign fighters.

"An investigation is under way as to how far this network goes, whether there is a cell in the country, and what the methods of recruiting and funding are," Mr Mahlobo told The Star.

"We cannot allow South Africa to be used as a recruitment space."

The girl was released into the care of her family after being questioned.

In February, the United Nations Security Council warned South Africa against terror groups that may use the country as an operational base.