Ferdinand's chief concern after 1823 was how to solve the problem of his own succession. He was married four times in his life, and bore two daughters in all his marriages; the succession law of Philip V of Spain, which still stood in Ferdinand's time, excluded women from the succession. By that law, Ferdinand's successor would be his brother, Carlos. Carlos, however, was a reactionary and an authoritarian who desired the restoration of the traditional moralism of the Spanish state, the elimination of any traces of constitutionalism, and a close relationship with the Roman Catholic Church. Though surely not a liberal, Ferdinand was fearful of Carlos's extremism. War had broken out in neighboring Portugal in 1828 as a result of just such a conflict between reactionary and moderate forces in the royal family – the War of the Two Brothers.