After Britain declared war on France in 1803, initiating the
Napoleonic Wars, Maxwell returned to active service in command of the
sloop-of-war . Within days of war start,
Cyane captured two French transports destined for the Caribbean, and later served in the
West Indies, on one occasion exchanging fire with two large French frigates off
Martinique. This fortified position was able to severely restrict French shipping from entering or leaving
Fort-de-France. During the invasion of Surinam, his command over the British naval forces present and capture of a succession of Batavian forts along the
Suriname River were highly commended. Maxwell's decisive leadership was essential in the rapid movement of British troops over water to prevent the Batavian defenders from preparing fresh defensive positions; the colony surrendered after the British reached
Paramaribo, resulting in the capture of 2,000 prisoners, several ships and large quantities of supplies. British losses during the invasion numbered less than 30.
Mediterranean service In 1805 Maxwell took command of the frigate off
Jamaica, participating in the
Atlantic campaign of 1806 as part of the squadron under Rear-Admiral
Sir Alexander Cochrane that drove off a French attack on the Jamaica convoy near
Tortola on 4 July 1806. In 1807, Maxwell was transferred to the Mediterranean in . He was initially part of a raiding squadron that attacked coastal batteries and other positions along the Spanish coast as part of the
war between Britain and Spain. On 8 April 1808, shortly before Spain allied with Britain, he
destroyed a Spanish convoy carrying military stores off
Rota. Over the next two years Maxwell became an expert at raiding the French, Italian and Spanish coasts, destroying numerous Italian
Martello towers and small armed vessels. In May 1810 he was commended for a raid at
Frejus, where he led a landing party that stormed and destroyed a coastal fort and seized a coastal convoy.
Adriatic campaign Maxwell's most notable service came during the
Adriatic campaign of 1807–1814.
Alceste was despatched to the
Adriatic Sea to support
James Brisbane in the absence of
William Hoste, who had been wounded at the
Battle of Lissa in March 1811. On 4 May, Maxwell and Brisbane led an attack on
Parenza, where a brig carrying supplies to
Ragusa had taken shelter. Seizing an island at the mouth of the harbour, the British established a
mortar position overlooking the anchorage, and sank the brig with a heavy bombardment. In November 1811, with the temporary absence of Brisbane, Maxwell became the senior officer in the Adriatic. Seven months later, a convoy of French frigates carrying
cannon from
Corfu to
Trieste was spotted attempting to slip past his base of operations on the island of
Lissa. Ashore in
Port St. George, Maxwell was informed by
telegraph, and led
Alceste and the rest of his squadron— and —in pursuit. On 29 November, after a night's chase, the British caught their opponents near
Pelagosa. The French force consisted of the large frigates
Pauline and
Pomone, and the armed storeship
Persanne. In the
battle that followed,
Unite pursued and, after a lengthy chase, seized the smaller
Persanne, while Maxwell and
James Alexander Gordon in
Active engaged the frigates. The action was bitterly contested, the British taking 61 casualties, including Gordon who lost a leg. However,
Alceste and
Active successfully isolated
Pomone, and when another British ship, , appeared in the distance,
Pauline fled. Alone and having lost heavily,
Pomone surrendered. The prizes were later sold along with their cargo of 200 cannon. Maxwell, despite attributing most of the credit for the victory to the wounded Gordon, was rewarded in 1812 with command of , a former
Italian frigate captured at the Battle of Lissa.
HMS Daedalus Maxwell commanded
Daedalus for less than a year. On 2 July 1813 the frigate ran aground on a shoal off
Galle,
Ceylon, causing serious damage to her keel. Although she was soon brought off, the leaks created in the grounding became so severe that Maxwell had no option but to order his crew to cease their desperate attempts to keep her afloat and abandon ship. He was the last to leave and shortly after he had been transported to a nearby
East Indiaman,
Daedalus rolled over and sank. Maxwell returned to Britain to face a
court-martial but was exonerated for the frigate's loss and reappointed to
Alceste. In 1815 he was made a
Companion of the Order of the Bath for his naval service, and although the war against France had ended, was retained for active duty at the special request of
Lord Amherst. ==Voyage to China and shipwreck==