The Battle of Cape St. Vincent was a naval encounter off Cape St. Vincent between a Liberal fleet under the command of British naval officer Charles Napier against a Miguelite fleet under the command of Portuguese naval officer Manuel Marreiros, which was fought on 5 July 1833 during the Liberal Wars and resulted in a decisive victory for the Liberal fleet. Over the course of the battle, the Liberal fleet, despite being significantly outnumbered by the Miguelite fleet and lacking any ships of the line compared to the Miguelite four, managed to close with the Miguelites, board their ships and engage in hand-to-hand combat. The early exchange of cannon fire between the two fleets went on for some time before Napier decided that his numerically inferior squadron could not last long against the Miguelite fleet, and sailed his ships directly towards the Miguelite fleet.
 This decision by Napier was the deciding factor in the outcome of the battle, and the Miguelite crews proved no match for the Liberal crews, most of them being former Royal Navy personnel that had been discharged and sought service under Pedro I of Brazil. The battle resulted in four Miguelite ships of the line, one frigate and one corvette being captured, and the remainder of the Miguelite fleet retreating from the engagement. The action took place in context of the Liberal Wars, a Portuguese civil war fought between the King of Portugal, Dom Pedro, and a pretender named Don Miguel, whose supporters were called Miguelites.  The battle had a decisive effect on the war, since the Miguelite fleet at Cape St. Vincent was the last significant naval force that Don Miguel could muster, his other naval forces being lost in the Battle of the Tagus on 11 July 1831 against a French fleet led by Albin Roussin. The Miguelite-held Lisbon, deprived of any chance to be resupplied via the sea, quickly capitulated.
 Whilst serving in the Royal Navy near the Azores, Napier had become acquainted with some exiled Portuguese liberals, who had offered him command of the small fleet that Dom Pedro had under his command. The fleet at that point largely consisted of a few aging frigates and corvettes, along with some East Indiamen purchased from the British. In February 1833, Napier, wishing to have a chance to see combat again, accepted their proposals to become head of the Liberal Fleet and replaced another British officer, Captain George Rose Sartorius, who was already serving as Admiral of Pedro's navy before deciding to rescind his position. Napier gave himself a nom-de-guerre, 'Carlos de Ponza', in a transparent attempt to disguise his true identity as a British officer when enlisting. The name 'Carlos de Ponza', meaning Charles of Ponza in English, was a deliberate reference to one of Napier's most daring feats in the Napoleonic Wars when he captured the French-held island of Ponza in the Mediterranean in 1813. The reasoning behind the name change was to escape the penalties under the Foreign Enlistment Act of 1819 which forbade British citizens to enlist in the armed forces of a foreign nation. In June 1833, Napier joined his new command in the Douro River off Oporto.
 Dom Pedro, who was currently trapped and besieged in Oporto by the forces of Dom Miguel, bestowed on Napier his commission as Vice Admiral, Major General of the Portuguese Navy and Commander in Chief of the fleet. An eccentric but indomitable character, Napier restored order among the fleet, which had been close to mutiny due to lack of pay, and proposed a new strategy to break the siege. Flying his flag in the frigate Rainha de Portugal, commanded by Captain F.G. MacDonough and with his stepson Charles Elers Napier as Chief of Staff, on 20 June he set sail from Oporto with his small fleet. The initial aim for Napier was to transport the Duke of Terceira and half the total armed forces available to the Liberal to the Algarve so that they could open a second front in the south of the country against the Miguelite forces and march on and capture Lisbon. After successfully disembarking this force, on the return voyage he encountered the considerably superior fleet of Dom Miguel under the command of Miguelite admiral Manuel Marreiros off Cape St. Vincent on 3 July 1833, and after two days of manoeuvring in calm and very light winds he engaged the Miguelite fleet.
 After two days of manoeuvring in very favourable conditions, Napier’s force was positioned to engage the Miguelite fleet. The Miguelite fleet significantly outnumbered the Liberal one, and aimed to defeat the Liberal via superior firepower. Both fleets were essentially the remnants of the Portuguese navy that had fought in the Napoleonic Wars, being divided during the outbreak of war. Napier's squadron consisted of six ships: three frigates, a corvette, a brig and a schooner, mounting a total of 176 guns. He had some small steamers under his command which he hoped to use as tugs, but they abandoned him while the two forces were becalmed on the 4th of July: thus the subsequent battle was perhaps the last significant naval engagement during the Age of Sail that was entirely fought by sailing ships. On 5 July, the wind eventually changed to allow Napier's ships to move forwards, and at 4.00 p.m. he engaged the Miguelite fleet which consisted four ships of the line, a frigate, a xebec, three corvettes and a brig, mounting altogether 372 guns.
 As the fighting commenced, it was clear that Napier could not match Marreiros in terms of firepower, and if the battle continued like this his fleet would be defeated in short order. Knowing that his ships could not continue to sustain a cannonade from such a superior opponent, Napier ordered his ships to sail directly towards the Miguelite vessels and attempt to board and capture them in hand-to-hand combat. With his flagship leading the manoeuvre, the Liberal fleet sailed next to the ships of the line of the Miguelite fleet and managed to board them, with fierce hand-to-hand fighting ensuing as the Miguelites desperately but fruitlessly attempted to repel the boarders. After this, the battle was practically decided; all four ships of the line, a frigate and a corvette were easily overpowered and captured. A major reason for the Liberal victory was that the majority of the Liberal crews were British veterans from the Royal Navy who were far better trained and equipped than the inexperienced and ill-equipped Portuguese crew of the Miguelite fleet. In the battle the Liberal forces captured all four ships of the line, a frigate and a corvette, whose surviving crews agreed to fight for the Liberal cause and swear allegiance to Don Pedro. The remaining Miguelite fleet, seeing their position, fled either to Lisbon or Madeira. Napier’s losses were about 30 killed, including the captain of Rainha de Portugal and two other captains, and about 60 wounded, including Charles Elers Napier, against 300 killed and wounded aboard the Miguelite fleet, including the Admiral of the Miguelite fleet, Manuel António Marreiros.
 Some time after the conclusion of the battle, the sailors of his fleet became ravaged by cholera outbreak which was raging on in mainland Portugal, with an appalling loss of life among the crews of his fleet resulting in more deaths from cholera amongst his men than from combat against the Miguelite fleet. Despite this, Napier was able to bring the Liberal fleet and the captured Miguelite prizes safely into Lisbon, which the Miguelites had precipitately abandoned after being defeated by Terceira’s army advancing from the south at the Battle of Almada, a major Liberal victory. On 6 July, receiving news of the victory, Dom Pedro named Napier as Viscount Cape St Vincent in the peerage of Portugal. Napier visited Rear-Admiral Sir William Parker, stationed on the Tagus to protect British interests, and was received according to his Portuguese rank as an Admiral. Though he was subsequently struck off the Royal Navy List at the insistence of the French, he was restored to his rank in the Royal Navy within two years and the battle, largely won by British officers and crews, was viewed in the United Kingdom as maintaining the honour of the Royal Navy, which had reached the apogee of its success during the preceding Napoleonic Wars.
 Continuing his Portuguese services, Napier commanded land forces in the successful defence of Lisbon on September 1833.  For these services he was made Grand Commander of the Tower and Sword, and Count of the Cape of Saint Vincent. On 12 September 1833, he captured the Miguelite The Lord of the Isles steamer at Sao Martinho and in 1836 defended his prize in the Court of Common Pleas. In 1834, with a small army made up largely of British sailors, he reconquered the Minho region for the Liberal cause. In the meantime, the Battle of Asseiceira, fought between the Liberal and Miguelite armies on May 16, 1834, resulted in a decisive Liberal victory, putting an end to the Liberal Wars.  The Miguelite army was still formidable, numbering about roughly 18,000 men, but on May 24, 1834, at Evoramonte, a peace treaty was signed under a concession by which Dom Miguel formally renounced all claims to the throne of Portugal, was guaranteed an annual pension, and permanently exiled from Portugal. Dom Pedro restored the Constitutional Charter, but he died on September 24, 1834. Maria da Glória resumed her interrupted reign as Maria II of Portugal, until she finally died in 1853.
 After the final defeat of Miguel and the death of Dom Pedro shortly afterwards, Napier found himself frustrated in his attempts to reform the naval administration of Portugal and returned to England. His departure was followed by a vote of thanks to him in both houses of the restored Portuguese parliament. Napier unsuccessfully contested the Portsmouth parliamentary seat for a second time in the by-election of December 1834. He then occupied himself until 1836 with writing a history of the Portuguese War and his own part in it.