Hamilton commanded the division until 1813, his troops seeing further action defending the town of Alba de Tormes against an army under Marshal Soult in November 1812. In 1813 after four years continuous campaigning, Hamilton was forced to return to England on sick leave and during his absence he was made a Knight Grand Cross of the Order of the Tower and Sword by the Portuguese monarchy and was knighted by the Prince Regent as well as being made honorary colonel of the 2nd Ceylon Regiment. Hamilton returned to his division in late 1813 and commanded them during the last of the fighting in the Peninsula War, seeing action at the Battle of Nivelle. Following the Peace of Fontainebleau, Hamilton returned to the British Army, was made lieutenant general in recognition of his service and placed in the quiet command of Duncannon Fort.