Designing complex physical systems, including photonic structures, is typically a tedious trial-and-error process that requires extensive simulations with iterative sweeps in multi-dimensional parameter space. To circumvent this conventional approach and substantially expedite the discovery and development of photonic structures, here we develop a framework leveraging both a deep generative model and a modified evolution strategy to automate the inverse design of engineered nanophotonic materials. The capacity of the proposed methodology is tested through the application to a case study, where metasurfaces in either continuous or discrete topologies are generated in response to customer-defined spectra at the input. Through a variational autoencoder, all potential patterns of unit nanostructures are encoded into a continuous latent space. An evolution strategy is applied to vectors in the latent space to identify an optimized vector whose nanostructure pattern fulfills the design objective. The evaluation shows that over 95% accuracy can be achieved for all the unit patterns of the nanostructure tested. Our scheme requires no prior knowledge of the geometry of the nanostructure, and, in principle, allows joint optimization of the dimensional parameters. As such, our work represents an efficient, on-demand, and automated approach for the inverse design of photonic structures with subwavelength features.