In this work, we have investigated the structural, electronic, and optical properties of the halide-perovskite NaMgCl3 by performing first-principles calculations using a mixed basis of the full-potential linearized augmented plane wave (FP-LAPW) approach under the generalized gradient approximation (GGA-PBEsol), a revised Perdew-Burke-Ernzerhof, and the modified Becke-Johnson (TB-mBJ) implemented on the Wien2k package. The obtained results show that NaMgCl3 is more stable in the nonmagnetic phase. The compound is found to be thermodynamically and elastically stable. It is found that there is a good agreement between the calculated lattice constants and the values published in previous studies. The complete set of first-order elastic constants tensor has been calculated, implying mechanical stability. The Young's modulus, shear modulus, Poisson's ratio,Pugh's ratio, and universal anisotropy index have been additionally calculated. The atomic bonds along both x and y axis are stronger than those along the z-axis. The Debye temperature is calculated using the average sound velocity. From electronic band structures, we have found that NaMgCl3 is an insulator with a direct wide band gap ΓV→ΓC. The electronic charge densities were plotted. Analysis of the charge density distribution map reveals that the bondings in NaMgCl3 are ionic. The calculated density of states (DOS) indicates that the valence band is mainly dominated by Cl− anions, the conduction band is mainly dominated by Mg2+ cations, whereas Na+ has a negligible contribution. The optical characteristics, notably the dielectric function tensor, refractive function, reflectivity, absorption coefficient, photo-conductivity and transmittance were plotted and discussed. The optical properties confirm that NaMgCl3 is optically anisotropic in 10-24 eV range . The low transmittance and high absorption coefficient in the far ultra-violet region, between 90 and 250 nm, make this compound a good candidate for use as an ultraviolet shield, in vacuum ultraviolet lenses and in thermoelectric promising features due to his direct wide band gap. Experimental and theoretical data are scarce for this compound in an ilmenite-type structure.