United Kingdom of Portugal, Brazil and the Algarves, but Ramírez and López feared that by joining the war their provinces would be invaded as well, so instead they agreed on a defense pact with Buenos Aires. This pact would be ratified by the quadrilateral treaty of 1822. During this period, the provinces maintained national unity though treaties, being ruled by caudillos. Buenos Aires lost the authority to appoint governors in the provinces, which increased their autonomy. Santa Fe was the first province to write a provincial constitution. Ramírez proclaimed the independence of the Republic of Entre Ríos, with the intention to annex Paraguay and Buenos Aires and liberate the Banda Oriental with their combined forces, but this short-lived project ended after his assassination. The province of Corrientes was split from Entre Ríos after the disestablishment of the proposed state. First presidential attempt The Banda oriental, which had been annexed into the Kingdom of Brazil and renamed as Cisplatina, was liberated by the Thirty-Three Orientals, and proclaimed its adhesion to the United Provinces. The now Empire of Brazil did not recognize it, leading to the Cisplatine War. It was thought then in Buenos Aires that to wage the war the country should have a proper head of state, so a new congress began to write a constitution for this, which would be enacted in 1826. However, because of the urgency, Bernardino Rivadavia was not appointed president after the promulgation of said constitution, but through a special law that created the office of president. The new constitution was a republican one, defining the existence and function of the three powers. It referenced the country as "Argentina". Rivadavia and the 1826 constitution found strong resistance from both unitarians and federalists. The unitarians did not support the law that turned Buenos Aires into the capital city of Argentina and nationalized its port, as the Buenos Aires province would lose the exclusive benefit from it. The federalists did not accept that the president would have the power to appoint provincial governors. His authority was further weakened by the outcome of the war: despite of some military victories against Brazil, Rivadavia wanted the army to return and protect him from an attack from the other provinces, so he ordered to hasten a treaty ending the war. This treaty did not formalize the region as an Argentine province, but as the independent country of Uruguay. Highly unpopular,