1814 battle during the War of 1812
The Battle of Baltimore (September 12–15, 1814) took place between British and American forces in the War of 1812. American forces repulsed sea and land invasions off the busy port city of Baltimore, Maryland, and killed the commander of the invading British forces. 
The British and Americans first met at the Battle of North Point. Though the Americans retreated, the battle was a successful delaying action that inflicted heavy casualties on the British, halted their advance, and allowed the defenders at Baltimore to prepare for an attack.
The resistance of Baltimore's Fort McHenry during bombardment by the Royal Navy inspired Francis Scott Key to compose the poem "Defence of Fort M'Henry", which later became the lyrics for "The Star-Spangled Banner," the national anthem of the United States.
Future U.S. president James Buchanan served as a private in the defense of Baltimore.
Background.
Until April 1814, Britain was at war against Napoleonic France, which limited British war aims in America. Meanwhile, the British primarily used a defensive strategy and repelled American invasions of the Provinces of Upper and Lower Canada. The Americans gained naval control over Lake Erie in 1813 and seized parts of western Ontario. In the Mississippi Territory, in an area in modern central Alabama, General Andrew Jackson destroyed the military strength of the Creek nation at the Battle of Horseshoe Bend in 1814.
Although Great Britain was unwilling to draw military forces from the war with France, it still enjoyed a naval superiority on the ocean, and vessels of North America and West Indies Squadron, based at Bermuda, blockaded American ports on the Atlantic throughout the war, strangling the American economy. Initially, the north-eastern ports were spared this blockade as public sentiments in New York and New England were against the war. The Royal Navy and Royal Marines also occupied American coastal islands and landed military forces for raids along the coast, especially around the Chesapeake Bay, encouraging enslaved blacks to defect to the Crown and recruiting them into the Corps of Colonial Marines.
Following the defeat of Napoleon in the spring of 1814, the British adopted a more aggressive strategy, intended to compel the United States to negotiate a peace that restored the pre-war status quo. Thousands of seasoned British soldiers were deployed to British North America. Most went to the Canadas to re-enforce the defenders. The British Army, Canadian militias, and their First Nations allies drove the American invaders back into the United States. Without naval control of the Great Lakes they were unable to receive supplies, resulting in the British failure to capture Plattsburgh in the Second Battle of Lake Champlain and their withdrawal from US territory. 
A brigade under the command of Major General Robert Ross was sent in early July with several naval vessels to join the forces already operating from Bermuda. The combined forces were to be used for diversionary raids along the Atlantic coast, intended to force the Americans to withdraw forces from Canada. Some historians claim that they were under orders not to carry out any extended operations and were restricted to targets on the coast. 
However, the British had launched three major operations targeting the three largest ports of America at Baltimore, New York City, via Lake Champlain and the Hudson River, and in New Orleans from August 1814 to February 1815. Each of these three expeditions had over 10,000 British Army troops, many of them the best soldiers and officers from the Peninsular War, so they were not just minor diversionary raids. Britain had already captured most of modern-day Maine and re-established the Crown colony of New Ireland in September 1814.
An ambitious raid was planned as the result of a letter sent to Bermuda on 2 June by Sir George Prévost, Governor General of The Canadas, who called for retaliation in response to the "wanton destruction of private property along the north shores of Lake Erie" by American forces under Colonel John Campbell in May, the most notable being the Raid on Port Dover. Prévost argued that,
... in consequence of the late disgraceful conduct of the American troops in the wanton destruction of private property on the north shores of Lake Erie, in order that if the war with the United States continues you may, should you judge it advisable, assist in inflicting that measure of retaliation which shall deter the enemy from a repetition of similar outrages.
The letter was considered by Ross and Vice-Admiral Sir Alexander Cochrane, who had replaced Sir John Borlase Warren earlier that year as the Commander-in-Chief of the North America and West Indies Station of the Royal Navy, headquartered at Admiralty House in Bermuda, in planning how to use their forces. Cochrane's junior, Rear Admiral George Cockburn, had been commanding ships of the squadron in the operations on the Chesapeake Bay since the previous year.
On 25 June he wrote to Cochrane stressing that the defenses there were weak, and he felt that several major cities were vulnerable to attack. Cochrane suggested attacking Baltimore, Washington and Philadelphia. On 17 July, Cockburn recommended Washington as the target, because of the comparative ease of attacking the national capital and "the greater political effect likely to result".
On 18 July, Cochrane ordered Cockburn that to "deter the enemy from a repetition of similar outrages..." You are hereby required and directed to "destroy and lay waste such towns and districts as you may find assailable". Cochrane instructed, "You will spare merely the lives of the unarmed inhabitants of the United States".
In August, the vessels in Bermuda sailed from the Royal Naval Dockyard and St. George's to join those already operating along the American Atlantic coast. After defeating a US Navy gunboat flotilla, a military force totaling 4,370, composed of British Army, Royal Marines, and Royal Navy detachments for shore service, under Ross was landed in Virginia. After beating off an American force of 1,200 on the 23rd, on the 24th they attacked the prepared defenses of the main American force of roughly 6,400 US Army soldiers, militiamen, US Marines, and US Navy sailors in the Battle of Bladensburg. 
Despite the considerable disadvantage in numbers, as standard military logic dictates that a three-to-one advantage is needed in carrying out an attack on prepared defenses, and sustaining heavy casualties, the British force routed the American defenders and cleared the path into the capital. President James Madison and the entire government fled the city, and went North, to the town of Brookeville, Maryland.
On 24 August 1814, British troops led by Rear Admiral George Cockburn and Major General Robert Ross entered Washington and captured the city with a force of 4,500 "battle-hardened" men, during the burning of Washington. British troops, commanded by Ross, set fire to a number of public buildings, including the White House and the United States Capitol. Extensive damage to the interiors and the contents of both were reported. The British forces returned to their ships.
The British sent a fleet up the Potomac to cut off Washington's water access and threaten the prosperous ports of Alexandria, just downstream of Washington, and Georgetown, just upstream. The mere appearance of the fleet cowed American defenders into fleeing from Fort Warburton without firing a shot, and undefended Alexandria surrendered. The British spent several days looting hundreds of tons of merchandise from city merchants.
They then turned their attention north to Baltimore, where they hoped to strike a powerful blow against the demoralized Americans. Baltimore was a busy port and was thought by the British to harbor many of the privateers who were raiding British shipping. The British planned a combined operation, with Ross launching a land attack at North Point, and Vice-Admiral Sir Alexander Cochrane laying siege to Fort McHenry, which was the point defensive installation in Baltimore Harbor.
Baltimore's defenses had been planned and overseen by the state militia commander, Major General Samuel Smith.
Battle.
North Point.
The British landed a force of 5,000 troops who marched toward Baltimore and first met heavy resistance at the Battle of North Point, which was fought on September 12 about 5 miles (8 km) from the city. The city's defense was under the overall command of Major General Samuel Smith, an officer of the Maryland Militia. He dispatched roughly 3,000 men under the command of General John Stricker to meet the British in a forward engagement. General Stricker was to stall the British invasion force to delay the British advance long enough for Major General Smith to complete the defenses in Baltimore.
The land invasion force for the British was led by Ross, who was killed in the second shift of the American defense by an American sharpshooter. It has been suggested that either Daniel Wells or Henry McComas of Captain Aisquith's rifle company, of the 5th Maryland Militia regiment was responsible, and both were killed shortly afterwards.
After Ross's death, the British army came under the command of Colonel Arthur Brooke. The Americans had already begun to form an organized retreat back to the main defenses of Baltimore, where they awaited a British assault.
Hampstead Hill.
Rodgers Bastion, also known as Sheppard's Bastion, located on Hampstead Hill, now part of Patterson Park, was the centerpiece of a 3-mile-wide earthworks from the outer harbor in Canton, north to Belair Road, dug to defend the eastern approach to Baltimore against the British. The redoubt was assembled and commanded by U.S. Navy Commodore John Rodgers, with General Smith in command of the overall line. At dawn on September 13, the day after the Battle of North Point, some 4,300 British troops advanced north on North Point Road, then west along the Philadelphia Road (now Maryland Route 7) toward Baltimore. U.S. troops were forced to retreat to the main defensive line around the city. The British commander, Col. Arthur Brooke, established his new headquarters at the Sterret House on Surrey Farm, now called Armistead Gardens, about two miles east-northeast of Hampstead Hill.
When the British began probing actions on Baltimore's inner defenses, the American line was defended by 100 cannons and more than 10,000 regular troops, including two shadowing infantry regiments commanded by general officers Stricker and Winder as well as a few thousand local militia and irregulars. The defenses were far stronger than the British anticipated. The American defenders at Fort McHenry successfully stopped British naval forces but a few ships were still able to provide artillery support.
Once the British had taken the outer defenses, the inner defenses became the priority. The British infantry had not anticipated how well defended they would be, so the first attack was a failure. However, Brooke's forces managed to outflank and to overrun American positions to the right. After a discussion with lower ranking officers, Brooke decided that the British should bombard the fort instead of risk a frontal assault and, at 3:00 a.m. on September 14, ordered the British troops to return to the ships.
Fort McHenry.
At Fort McHenry, some 1,000 soldiers under the command of Major George Armistead awaited the British naval bombardment. Their defense was augmented by the sinking of a line of American merchant ships at the adjacent entrance to Baltimore Harbor in order to further thwart the passage of British ships.
The attack began on September 13, as the British fleet of some nineteen ships began pounding the fort with Congreve rockets (from rocket vessel HMS "Erebus") and mortar shells (from bomb vessels "Terror", "Volcano", "Meteor", "Devastation", and "Aetna"). After an initial exchange of fire, the British fleet withdrew to just beyond the range of Fort McHenry's cannons and continued to bombard the American redoubts for the next 25 hours. Although 1,500 to 1,800 cannonballs were launched at the fort, damage was light because of recent fortification that had been completed prior to the battle.
After nightfall, Cochrane ordered a landing to be made by small boats to the shore just west of the fort, away from the harbor opening on which the fort's defense was concentrated. He hoped that the landing party might slip past Fort McHenry and draw Smith's army away from the main British land assault on the city's eastern border. That gave the British a good diversion for half an hour and allowed them to fire again and again. 
On the morning of September 14, the oversized American flag, which had been made a year earlier by local flagmaker Mary Pickersgill and her 13-year-old daughter, was raised over Fort McHenry, replacing the tattered storm flag