Complex sentence: Almeida was garrisoned by Aranda, but it remained the only major fortress in Spanish hands by the close of the war, and was returned to the Portuguese following the Treaty of Paris in exchange for the return of Cuba and the Philippines to Spain by the British.
Split into simpler sentences: Almeida was garrisoned by Aranda, but it remained the only major fortress in Spanish hands by the close of the war. It was returned to the Portuguese following the Treaty of Paris in exchange for the return of Cuba and the Philippines to Spain by the British.