The story starts in 1573 with the establishing of trading routes between the Spanish colonies in the Philippines and Japanese merchants who came to exchange gold and silver. While initially a peaceful coexistence (as peaceful as a western colony at the other side of the world can be, anyways), conflict arose in 1580 when a Japanese wako or pirate warlord attacked the colonies and forced the region of Cayagan (in the island of Luzon) into submission. Those pirates, whom the Spaniards suspected could be actually Privateers for the Emperor Ogimachi, were already known in the colonies, as they came every time they heard about a chance to grab for free what they originally had to pay for. They were indirectly helped at this by the Portuguese, who disputed sea commerce with Spain and had provided Japan with modern guns and gunpowder, turning their banditry activities into a potential danger. When the colonies failed to repel the attacks, they resorted to the famed Spanish Navy and commissioned veteran captain Juan Pablo de Carrión to solve the situation.
Carrión made a big entrance in the conflict by intercepting a pirate ship in the South China sea and forcing him to flee by cannon fire. This had the effect to stir up the entire wako community, which was led by a pirate lord of name recorded as Tay Fusa (probably a Spanish misunderstanding of the term Taifu-sama, meaning chieftain). While Tay Fusa gathered a fleet of 18 sampan boats carrying around 1000 fighters, Carrión did the same with what he could find in the colonies, embarking 40 soldiers and some tough war sailor crews in seven ships of varied sizes. The two fleets eventually met in the coast of Cagayan, where the Spaniards were investigating a recent pirate incursion, marking the beginning of the battles.
As Carrión and his fleet entered the Cagayan river, they encountered a wako junk ship which might have been the perpetrator of the attack. The Spanish captain detached his galley flagship from the fleet, as it was the fastest boat, and intercepted the junk, intending to board and capture what seemed an easy prey. The mission immediately went sour for the Spanish when the junk revealed to carry much more fighters than their galley, which led to the Japanese counter-boarding them and forced Carrións men to fight for their lives. Only after executing an improvised land formation on the deck (and by the timely arrival of the rest of the Spanish fleet) they turned the tide on the pirates. Unwilling to surrender, many of the Japanese jumped to the sea and most of them drowned due to their heavy armor. Free to continue, Carrión and his men continued down the river, where the main Japanese fleet is based.
The fleets finally met in what is now Lal-lo, where Tay Fusa's pirates had built a fort. The two forces exchanged cannon fire, which gave the advantage to the Spaniards thanks to their larger guns and better artillery crews. After overpowering the pirate fleet, Carrión ordered for the men to disembark and erect the cannons by the riverside, build a trench and to continue harassing the Japanese. After a particularly harsh exchange, Tay Fusa initiated negotiations in an attempt to get gold through peace, but the Spaniards characteristically told them to go to hell, so the pirates opted for a last-ditch effort attack with their remaining 600 fighters in hopes to overwhelm them by sheer numbers. The Spanish trench suffered three increasingly wild Japanese assaults through the day, but they managed to hold the lines and inflict them heavy losses through their tactical superiority, after which the pirates finally decided to abandon the battle and run away.
In order to further pacify the region, Carrión founded the city of Nueva Segovia, current day Lal-lo. Pirate activity persisted, but only sparsely, and commerce surged. The colonies ended up establishing a peace and trade treaty with Japan in 1590, though Toyotomi Hideyoshi never lost the penchant for demanding the Spanish Empire to hand over Luzon, which he never got.
- The Spanish 2016 comic book Espadas del fin del mundo by Ángel Miranda and Juan Aguilera portrays those battles.