In this paper, a voltage and frequency control scheme based on model predictive control (MPC) is proposed for inverter-based distributed generations (DGs). Currents injected into an off-grid system (e.g. a passive network with loads or an islanded microgrid) at the point of common coupling (PCC) of the DG are considered as disturbances and used as feed-forward signals. These signals enhance the transient performance of the DG control system for a wide range of switched loads as well as for switching and operating the DG in an islanded microgrid. The stability and robustness of the proposed control scheme are analyzed and discussed. The effectiveness of the scheme is demonstrated by extensive time-domain simulations using PSCAD/EMTDC for various loads (such as balanced/imbalanced, nonlinear and dynamic loads), fault conditions, and DG operation after switching in an islanded microgrid. Comparison of the obtained results with those of three previously developed schemes shows superiority of the proposed scheme.