Control of single-phase converters connected to the grid via an LCL filter is a demanding issue due to risk of oscillations. A linear-quadratic (LQ) controller enabling besides standard pure sine control also a multiharmonic current reference is proposed in the paper. Such a design enables to control single-phase converters generating harmonic currents, e.g. shunt active filters, or converters operating under distorted voltage conditions. In order to reduce number of sensors, the proposed LQ control has been completed by a state estimator based on the Kalman filter.