This paper presents a new pattern synthesis algorithm for arbitrary arrays based on adaptive array theory. With this algorithm, the designer can efficiently control both mainlobe shaping and sidelobe levels. The element weights optimize a weighted L 2 norm between desired and achieved patterns. The values of the weighting function in the L 2 norm, interpreted as imaginary jammers as in Olen and Compton's method, are iterated to minimize exceedance of the desired sidelobe levels and minimize the absolute difference between desired and achieved mainlobe patterns. The sidelobe control can be achieved by iteration only on sidelobe peaks. In comparison to Olen and Compton's method, the new algorithm provides a great improvement in mainlobe shaping control. Example simulations, including both nonuniform linear and planar arrays, are shown to illustrate the effectiveness of this algorithm.