Iraq has massive potential for electricity generation from solar energy. Because the country currently suffers from daily electricity shortages, a grid-connected PV system is an unsuitable option since the PV cannot serve the load during the electricity blackouts. This paper aims to analyze the techno-economic and environmental feasibility of a solar PV microgrid system which is able to supply the load during both grid availability and outage periods. A household in Baghdad was selected as a case study. HOMER software was used to carry out the overall analysis using five different control strategies. The results indicated that the most economical configuration was achieved by allowing the grid to charge the batteries at all rates, with a net present cost (NPC) of $29,713. A sustainability assessment revealed that preventing the grid from charging the battery resulted in the highest renewable fraction and the lowest CO2 emissions with 64.9% and 4533 kg/year, respectively. Furthermore, inserting a diesel generator to an economically optimized system was found to reduce the NPC by 11.6%, while increasing the CO2 emissions by 32.7%. This study showed that implementing this sort of project can provide clean, economical, and continuous electricity production in countries with daily blackouts.