During Mahendravarman's reign, the Chalukya king Pulakeshin II attacked the Pallava kingdom. The Pallavas fought a series of wars (many wars) in the northern Vengi region. Mahendravarma saved his capital. But he lost the northern provinces to Pulakeshin II.