Staphylococcus aureus is an opportunistic bacterium causing a wide variety of diseases. Biofilm formation of Staphylococcus aureus is of primary public and animal health concern. The purposes of the present study were to investigate the ability of Staphylococcus aureus isolated from animals, humans, and food samples to form biofilms and to screen for the presence of biofilm-associated and regulatory genes. In total, 55 Staphylococcus aureus isolated from sheep mastitis cases (n = 28), humans (n = 19), and from food matrices (n = 8) were identified using matrix-assisted laser desorption/ionization time-of-flight mass spectrometry (MALDI-TOF MS). The ability of Staphylococcus aureus for slime production and biofilm formation was determined quantitatively. A DNA microarray examination was performed to detect adhesion genes (icaACD and biofilm-associated protein gene (bap)), genes encoding microbial surface components recognizing adhesive matrix molecules (MSCRAMMs), regulatory genes (accessory gene regulator (agr) and staphylococcal accessory regulator (sarA)), and the staphylococcal cassette chromosome mec elements (SCCmec). Out of 55 Staphylococcus aureus isolates, 39 (71.0%) and 23 (41.8%) were producing slime and biofilm, respectively. All Staphylococcus aureus strains isolated from food showed biofilm formation ability. 52.6% of the Staphylococcus aureus strains isolated from sheep with mastitis, and 17.9% of isolates from humans, were able to form a biofilm. Microarray analysis typed the Staphylococcus aureus into 15 clonal complexes. Among all Staphylococcus aureus isolates, four of the human isolates (21.1%) harbored the mecA gene (SCCmec type IV) typed into 2 clonal complexes (CC22-MRSA-IV and CC80-MRSA-IV) and were considered as methicillin-resistant, while two of them were slime-producing. None of the isolates from sheep with mastitis harbored the cna gene which is associated with biofilm production. The fnbB gene was found in 100%, 60% and 40% of biofilm-producing Staphylococcus aureus isolated from food, humans, and sheep with mastitis, respectively. Three agr groups were present and agr group III was predominant with 43.6%, followed by agr group I (38.2%), and agr group II (18.2%). This study revealed the capacity of Staphylococcus aureus isolates to form biofilms and highlighted the genetic background displayed by Staphylococcus aureus isolates from different sources in Algeria.