lasted two days. The Ilafy army lost the skirmish and retreated to their village. After losing these battles, the residents of Ilafy decided to submit to Andrianampoinimerina. To rid themselves of Andrianjafy, the people encouraged him to travel to Antananarivo and Alasora to seek allies in the defense of their town. Once he had departed, the villagers barred the town gates and announced their desire to enforce the decree of Andriambelomasina. Seeking support to recapture the throne, Andrianjafy traveled to Antananarivo, Ambohipeto, Alasora and Anosizato to secure an alliance, but each time he was rebuffed. The conflict came to an end in 1787 when Andrianampoinimerina exiled his uncle; varying sources report that shortly afterward Andrianjafy either died in exile or was killed by Andrianampoinimerina's followers. Reign and expansion of territory Reunification of historic Imerina Continuing his conquests in the 1790s, Andrianampoinimerina began establishing control over a comparatively large part of the highlands of Madagascar including the twelve sacred hills of Imerina. Andrianampoinimerina conquered Antananarivo in 1793 and concluded treaties with the kings of Antananarivo and Ambohidratrimo. He shifted the kingdom's political capital back to Antananarivo in 1794. By 1795 he had gained the allegiance and submission of all the territories that had formed Imerina at its largest extent under Andriamasinavalona, effectively achieving the reunification of Imerina. The former kings of Antananarivo and Ambohidratrimo periodically engaged in resistance against his authority in disregard of the treaties they had concluded, prompting Andrianampoinimerina to launch renewed campaigns to eliminate both kings; the re-pacification of Antananarivo began in 1794 and achieved definitive success in 1797, with Ambohidratrimo reconquered shortly afterward. By 1800, he had absorbed several other previously independent sections of Imerina into his kingdom. He reinforced alliances with powerful nobles in conquered regions of Imerina through marriage to local princesses, and is said to have wed 12 women in total. He placed each wife at a house built at each of the twelve sacred hills. After the political capital of Imerina was shifted back to Antananarivo, Andrianampoinimerina declared Ambohimanga to be the spiritual capital of Imerina. Conquest of greater Madagascar The latter half of Andrianampoinimerina's reign from around 1800 was marked by an effort to unite the island's 18 ethnic groups under his rule. This effort began with the sending of royal messengers bearing invitations to become vassal states under Andrianampoinimerina's sovereignty, or face a military conquest. The first focus of this expansion