This paper aims to study the techno-economical feasibility of a photovoltaic–diesel–battery hybrid energy system (HES) destined to electrify a research unit (UDES) located in the north of Algeria. For this aim several scenarios have been studied for a photovoltaic penetration varying from 0% to 100% including a stand-alone diesel system and a stand-alone photovoltaic system. For each scenario, the power system has been designed and optimized to get a maximum output power at a low cost. The performance of these systems has been analysed based on some determinant criteria such as net present cost, the cost of energy, energy excess, load satisfaction, fuel consumption savings, maintenance and operation costs of diesel generators, CO2 and pollutants saving rates. The impact of the storage battery bank size on the total cost of the power system has also been studied; it has been found that this parameter is a decisive factor that determines the optimum share of the solar resource in the hybrid system. Results showed that 25% PV–diesel–battery HES is the optimal configuration, which presents the best compromise between PV penetration efficiency, energy cost and the system stability. A sensitivity analysis has been performed on the optimal HES in order to study the effect of some parameters׳ variation (global solar radiation, diesel price, real interest rate and load consumption) on its total cost, the cost of energy, photovoltaic resource penetration and fuel intake.