I don't know how the classification was made, but the first picture suggests that the sub was operating in broad daylight, within a few hundred meters of the coast, with masts and possibly the sail visible to the naked eye from shore??? This was either an on-board emergency, some very, very careless submariners (not something submariners in any country are known for), or something else entirely.
The incredibly short distance from the coast suggests the possibility of an unmanned submarine to me. Territorial waters start at 13NM; operating at the 12.75NM is like conducting military operations 12.75NM inside a country's sovereign borders.