<P> After learning of the Castilian - sponsored voyage, the Portuguese King sent a threatening letter to the Catholic Monarchs stating that by the Treaty of Alcáçovas signed in 1479 and confirmed in 1481 with the papal bull Æterni regis, that granted all lands south of the Canary Islands to Portugal, all of the lands discovered by Columbus belonged, in fact, to Portugal . Also, the Portuguese King stated that he was already making arrangements for a fleet (an armada led by Francisco de Almeida) to depart shortly and take possession of the new lands . After reading the letter the Catholic Monarchs knew they did not have any military power in the Atlantic to match the Portuguese, so they pursued a diplomatic way out . On 4 May 1493 Pope Alexander VI (Rodrigo Borgia), an Aragonese from Valencia by birth, decreed in the bull Inter caetera that all lands west of a pole - to - pole line 100 leagues west of any of the islands of the Azores or the Cape Verde Islands should belong to Castile, although territory under Catholic rule as of Christmas 1492 would remain untouched . The bull did not mention Portugal or its lands, so Portugal could not claim newly discovered lands even if they were east of the line . Another bull, Dudum siquidem, entitled Extension of the Apostolic Grant and Donation of the Indies and dated 25 September 1493, gave all mainlands and islands, "at one time or even still belonging to India" to Spain, even if east of the line . </P> <P> The Portuguese King John II was not pleased with that arrangement, feeling that it gave him far too little land--it prevented him from possessing India, his near term goal . By 1493 Portuguese explorers had reached the southern tip of Africa, the Cape of Good Hope . The Portuguese were unlikely to go to war over the islands encountered by Columbus, but the explicit mention of India was a major issue . As the Pope had not made changes, the Portuguese king opened direct negotiations with the Catholic Monarchs, King Ferdinand and Queen Isabella, to move the line to the west and allow him to claim newly discovered lands east of the line . In the bargain, John accepted Inter caetera as the starting point of discussion with Ferdinand and Isabella, but had the boundary line moved 270 leagues west, protecting the Portuguese route down the coast of Africa and giving the Portuguese rights to lands that now constitute the Eastern quarter of Brazil . As one scholar assessed the results, "both sides must have known that so vague a boundary could not be accurately fixed, and each thought that the other was deceived, (concluding that it was a) diplomatic triumph for Portugal, confirming to the Portuguese not only the true route to India, but most of the South Atlantic". </P> <P> The treaty effectively countered the bulls of Alexander VI but was subsequently sanctioned by Pope Julius II by means of the bull Ea quae pro bono pacis of 24 January 1506 . Even though the treaty was negotiated without consulting the Pope, a few sources call the resulting line the "Papal Line of Demarcation". </P> <P> Very little of the newly divided area had actually been seen by Europeans, as it was only divided via the treaty . Castile gained lands including most of the Americas, which in 1494 had little proven wealth . The easternmost part of current Brazil was granted to Portugal when in 1500 Pedro Álvares Cabral landed there while he was en route to India . Some historians contend that the Portuguese already knew of the South American bulge that makes up most of Brazil before this time, so his landing in Brazil was not an accident . One scholar points to Cabral's landing on the Brazilian coast 12 degrees farther south than the expected Cape São Roque, such that "the likelihood of making such a landfall as a result of freak weather or navigational error was remote; and it is highly probable that Cabral had been instructed to investigate a coast whose existence was not merely suspected, but already known". </P>

Which treaty settled the territorial dispute between spain and portugal