Occurrence and distribution pattern of fungal endophytes in different tissues of halophytic plants across saline depressions are poorly studied. We investigated the endophytic fungal communities inhabiting roots, stems and leaves of Hordeum maritimum collected in a soil salinity gradient, i.e. non-saline, slightly saline and saline, using a culture-dependent approach. A total of 20 taxa belonging to Ascomycota phylum were identified by ITS rRNA gene sequence. Pyronema domesticum and Alternaria spp. were the most frequently isolated. Roots host higher diversity and were more frequently colonized by endophytes than aboveground organs. Endophytic composition of all organs surveyed differed according to salinity gradient. Contrary to expectations, the colonization rate of roots increased with soil salinity, indicating that under salt stress the endophyte-plant association is promoted. All the isolates exhibited in vitro saline tolerance, especially those belonging to genera Xylaria, Chalastospora, Alternaria and Pyronema. Fungal tolerance to NaCl under in vitro conditions appears to be more dependent on the isolates than on the sites of their isolation, suggesting that under natural conditions other factors, beyond soil salinity, should be taken into account. These findings highlight the importance of fungal endophytes in the protection and/or adaptation of both interacting species (plant-fungus) to salt stress under natural conditions. Graphical Abstract: [Figure not available: see fulltext.]