MADRID (Reuters) - Police said on Saturday they had discovered a hidden weapons cache and a home-made Islamic State flag in Ceuta, a Spanish enclave in Morocco, and are investigating a possible connection to Islamist militants.

The cache of four pistols, including an air gun modified to shoot live ammunition, two Scorpion sub-machine guns, ammunition and variety of knives, was found in perfect condition and buried on wasteland on Thursday, Spain's Interior Ministry said.

Spanish police have detained 15 people with suspected links to Islamic State militants so far this year and 102 people on the same charges last year after police stepped up security measures following attacks in Paris.

Ceuta and Melilla, Spain's other north African enclave, have been a focus of Spanish anti-militant investigations.

(Reporting by Paul Day; Editing by Alison Williams)